Skip to content

lib/api: /svc/lang disregards the passed quality values #9670

@acolomb

Description

@acolomb

What happened?

The GUI loads its locale preference list from the browser's settings through the /svc/lang API endpoint. The HTTP header value is however treated as being specified in reducing preference order, with the q= quality values being discarded.

It should be sorted by decreasing q value (where omission means q=1), according to the specification at https://httpwg.org/specs/rfc9110.html#field.accept-language

Different browsers may send the HTTP header value with different ordering. Therefore the sorting should be done in the backend API service.

Syncthing version

v1.27.10

Platform & operating system

n/a

Browser version

Header varies by browser, but service should sort the result

Relevant log output

No response

Metadata

Metadata

Assignees

Labels

apiIssues or pull requests that change public APIs (config, REST)bugA problem with current functionality, as opposed to missing functionality (enhancement)frozen-due-to-ageIssues closed and untouched for a long time, together with being locked for discussionneeds-triageNew issues needed to be validateduiIssues related to the graphical user interface

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions