Я пытаюсь создать простой сервер веб-приложений, используя QtWebApp
Но Chrome, Firefox и Chromium всегда запрашивают страницу дважды
HttpListener: Listening on port 8084
HttpConnectionHandler (0x642770): constructed
HttpConnectionHandler (0x6436e0): constructed
HttpConnectionHandler (0x642770): thread started
HttpConnectionHandler (0x642770): handle new connection
HttpConnectionHandler (0x642770): received request
request start --> with chrome/firefox/chromium
HttpConnectionHandler (0x6436e0): thread started
HttpConnectionHandler (0x6436e0): handle new connection
request end
HttpConnectionHandler (0x642770): received request
request start --> i'm not refreshing the page but this appear
HttpConnectionHandler (0x6436e0): read timeout occured
HttpConnectionHandler (0x6436e0): disconnected
request end
HttpConnectionHandler (0x642770): read timeout occured
HttpConnectionHandler (0x642770): disconnected
HttpConnectionHandler (0x6436e0): thread stopped
HttpConnectionHandler (0x6436e0): destroyed
HttpConnectionHandlerPool: Removed connection handler (0x6436e0), pool size is now 1
HttpConnectionHandler (0x642770): handle new connection
HttpConnectionHandler (0x642770): received request
request start --> when using curl
request end
HttpConnectionHandler (0x642770): disconnected
HttpConnectionHandler (0x6436e0): disconnected
HttpConnectionHandler (0x642770): read timeout occured
HttpConnectionHandler (0x642770): disconnected
HttpConnectionHandler (0x6436e0): thread stopped
HttpConnectionHandler (0x6436e0): destroyed
мой ответ от curl был просто:
> GET / HTTP/1.1
> User-Agent: curl/7.35.0
> Host: localhost:8084
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Type: text/html; charset=ISO-8859-1
< Transfer-Encoding: chunked
<
* Connection #0 to host localhost left intact
<html><body>-4417809641995</body></html>
в то время как на вкладке «Инструменты разработчика Chrome»> «Сеть» он отображается только один раз.
источник: Как создать приложение QtWebApp
Это проблема браузера или класса контроллера?
Как Florian Sowade
сказал в комментарии, второй запрос был /favicon.ico
Других решений пока нет …