Skip to content

fix: parse header as per http spec#1

Open
lego290 wants to merge 1 commit into
leafsphp:mainfrom
lego290:header-parsing-fix
Open

fix: parse header as per http spec#1
lego290 wants to merge 1 commit into
leafsphp:mainfrom
lego290:header-parsing-fix

Conversation

@lego290

@lego290 lego290 commented Jul 20, 2026

Copy link
Copy Markdown

What kind of change does this PR introduce? (pls check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe below

Description

The default implementation of the header handler retirns the contents of the Accept-Language header as it was sent without parsing it in any way. this makes the lingo()->getCurrentLocale() return values like en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7.

This pr updates the header handler to properly parse the Accept-Language heasder while also considering requested quality as per https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Accept-Language.

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

Related Issue

Issues are disabled on this repository and the Discord link is invalid so i have not been able to create an issue or discuss it with you first. So im submitting this here instead.

@lego290
lego290 marked this pull request as ready for review July 20, 2026 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant