atauenis / webone

HTTP 1.x proxy that makes old web browsers usable again in the Web 2.0 world.
Other
518 stars 18 forks source link

WebOne adds dummy content-type if server returns 304 (Not Modified) #119

Closed mgroeber9110 closed 6 months ago

mgroeber9110 commented 8 months ago

Version: 0.16.3

When making a conditional HTTP request where the server responds with a 304 (Not Modified) code, WebOne inserts a Content-Type header with webone/unknown-content-type.

This appears to be at least against the spirit of RFC7232 which suggests not returning additional metadata. In the case of the browser of the FreeGEOS project, I found that this would lead to incorrect behavior because the mime type would override the one stored in the cache (which is probably in itself a bug...).

Example:

$ curl -I http://www.mgroeber.de --header 'If-None-Match: "1006-60d7ffbc456d8"' -x 192.168.178.21:8080
HTTP/1.1 304 Not Modified
Date: Sun, 24 Mar 2024 20:44:40 GMT
Server: Apache/2.4.56(Debian)
ETag: "1006-60d7ffbc456d8"
Accept-Ranges: bytes
Last-Modified: Wed, 27 Dec 2023 16:06:36 GMT
Via: HTTP/1.0 WebOne/0.16.3.0
Content-Type: webone/unknown-content-type
Proxy-Connection: keep-alive
Connection: Keep-Alive