Spinoco / protocol

Various protocol decoders and encoders
MIT License
28 stars 9 forks source link

Parsing Accept header of newer Chrome fails #56

Open eikek opened 5 years ago

eikek commented 5 years ago

Hi, from some Android device running Chrome 73, the following Accept header is sent

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

The parser fails on the last v= part, saying expecting a q= instead:

Decoding of the request header failed: Headers/Accept/6: expected constant BitVector(16 bits, 0x713d) but got BitVector(16 bits, 0x763d)

I don't know what v= means. The user agent string is Mozilla/5.0 (Linux; Android 7.0; Lenovo TB-7304F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.90 Safari/537.36 and I'm using protocol-http version 0.3.12.

AdamChlupacek commented 5 years ago

@eikek Hello there,

Sorry for a bit delayed response, I have found out the issue, and made a fix for it #57 , it should be merged in during next week (0.3.18-SNAPSHOT) and then by the end of the week we may do full release.

Hope it is fine.

eikek commented 5 years ago

@AdamChlupacek Thank you! And no worries about delays.

AdamChlupacek commented 5 years ago

@eikek The snapshot is now released with this change, we are not doing full release yet as there is not enough changes from the last version yet, be free to use 0.3.18-SNAPSHOT, it is stable. We are using it in production as well.

eikek commented 5 years ago

Thanks @AdamChlupacek ; I now created a workaround such that all headers that failed to parse are ignored (mapped to empty values). For my apps that is just fine.