Closed rabbit20210221 closed 10 months ago
Thanks for your response. I ran the test with Grizzly 4.0.0 and found the same issue with curl. I modifed my original test program to include Grizzly version in response.
Test 1: curl GET -- no issues
$ curl -vv -H 'Accept: application/json' http://localhost:8080/time
* Trying 127.0.0.1:8080...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET /time HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/8.0.1
> Accept: application/json
>
< HTTP/1.1 200 OK
< Content-Type: application/json;charset=UTF-8
< Content-Length: 79
<
{ "name": "Grizzly,"version": "4.0.0,"time": "2023-10-07T00:37:10.670102600Z" }
Test 2: curl GET with "Upgrade: h2c" -- missing Content-Type header in Grizzly response
$ curl -vv -H 'Accept: application/json' -H 'Upgrade: h2c' http://localhost:8080/time
* Trying 127.0.0.1:8080...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET /time HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/8.0.1
> Accept: application/json
> Upgrade: h2c
>
< HTTP/1.1 200 OK
< Content-Length: 76
<
{ "name": "Grizzly,"version": "4.0.0,"time": "2023-10-07T00:38:20.201669Z" }
@rabbit20210221 I have confirmed the issue and looking into a fix
@mnriem Thanks for your quick reply.
@rabbit20210221 Can you try out the PR?
Response from Grizzly http server does not contain Content-Type header when client includes HTTP 2 upgrade headers.
I am not interested in HTTP 2 support, but expect Grizzly to give HTTP 1.1 response with Content-Type header.
Test program:
Output:
Note missing "content-type" in the first response.