kianschmalenbach / rdf-browser

A Firefox Add-on that requests RDF files and renders RDF files as Turtle documents with clickable links
MIT License
16 stars 6 forks source link

Request headers should not have more than 3 digits in the `q=` value #32

Closed DylanVanAssche closed 1 year ago

DylanVanAssche commented 2 years ago

Description

I have this plugin installed and works great with most things. However, it breaks the Solid Community Server IDP:

image

After some internal discussion, the cause seems to be this plugin as it generates floating point values with more than 3 digits. This is against the RFC7231 specification: https://datatracker.ietf.org/doc/html/rfc7231#section-5.3.1 which explicitly forbids it as:

A sender of qvalue MUST NOT generate more than three digits after the decimal point.

Disabling the plugin makes it work again.

Request headers

Accept: application/ld+json;q=1,application/n-quads;q=1,application/n-triples;q=1,application/rdf+xml;q=1,application/trig;q=1,text/turtle;q=1,text/n3;q=1,application/ld+json;q=0.95,application/n-quads;q=0.95,application/n-triples;q=0.95,application/rdf+xml;q=0.95,application/trig;q=0.95,text/turtle;q=0.95,text/n3;q=0.95,text/html;q=0.8999999999999999,application/xhtml+xml;q=0.8999999999999999,application/xml;q=0.7999999999999999,image/avif;q=0.8999999999999999,image/webp;q=0.8999999999999999,*/*;q=0.7
Accept-Language: en;q=0.9, de;q=0.8, *;q=0.5

How to reproduce

Environment

argahsuknesib commented 1 year ago

I faced this issue as well.

kianschmalenbach commented 1 year ago

Fixed in version 1.2.3.