Http headers should be CRLF-terminated, and you need two CRLF between the
last header and the start of the content.

Perhaps you should use the existing HTTP server codec, though, which takes
care of these details for you?

Rogan


On Wed, 24 Jul 2019 at 11:18 <[email protected]> wrote:

> My server gets:
> GET /jibberish HTTP/1.1
> Host: 127.0.0.1:80
> Connection: keep-alive
> Upgrade-Insecure-Requests: 1
> User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64)   AppleWebKit/537.36
> (KHTML, like Gecko) Chrome/75.0.3770.142  Safari/537.36
> Accept:
>  
> text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3
> Accept-Encoding: gzip, deflate,  br
> Accept-Language: en-US,en;q=0.9
>
> I sent a packet full of nonsense, chrome says,"This page is not working."
>
> I tried sending this packet "HTTP/1.1 200 OK\nDate: Wed, 24 Jul 2019
> 05:07:53 GMT\nServer: Custom  (Win64)\nLast-Modified: Wed, 24 Jul 2019
> 04:16:26 GMT\nETag: \"4014300565a5-2c-3e94b66c2e410\"\nAccept-Ranges:
> bytes\nContent-Length: 44\nConnection: close\nContent-Type: text/html;
> charset=UTF-8\nX-Pad: avoid browser bug\n<html><body><h1>It
> works!</h1></body></html>"
>
> Chrome just hangs...  any further help?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Netty discussions" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/netty/75292ecc-2299-4281-8ead-a469d70dc01b%40googlegroups.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Netty discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/netty/CAOYdKdhZxp-oa8GX4jQXKu_Y_Ti2JGWRDPSc_tUQBTZwo%3DAp-g%40mail.gmail.com.

Reply via email to