TeamSmil3y / PigeonPost

Python web framework • apparently easy to use
https://docs.pigeon.teamsmiley.org
MIT License
1 stars 0 forks source link

:bug: middleware ContentNegotiation Component fails when processing request from chromium #47

Closed lstuma closed 10 months ago

lstuma commented 10 months ago
b'GET / HTTP/1.1\r\nHost: localhost:8082\r\nConnection: keep-alive\r\nCache-Control: max-age=0\r\nsec-ch-ua: "Chromium";v="119", "Not?A_Brand";v="24"\r\nsec-ch-ua-mobile: ?0\r\nsec-ch-ua-platform: "Linux"\r\nUpgrade-Insecure-Requests: 1\r\nUser-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7\r\nSec-Fetch-Site: none\r\nSec-Fetch-Mode: navigate\r\nSec-Fetch-User: ?1\r\nSec-Fetch-Dest: document\r\nAccept-Encoding: gzip, deflate, br\r\nAccept-Language: en-US,en;q=0.9\r\n\r\n'

The component fails because the Accept header:

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed
-exchange;v=b3;q=0.7

has this: application/signed-exchange;v=b3;q=0.7 in it and the component can't parse the v param

@raspitim take a look at this

lstuma commented 10 months ago

versioning of accept header content-types is not mentioned here https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept v param seems to be for versioning. for now we'll just ignore it