brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
17k stars 2.21k forks source link

Parsing of Onion-Location header is different from Tor Browser #39578

Open fmarier opened 3 days ago

fmarier commented 3 days ago

Description

The specification for the Onion-Location header is unclear about two points:

Steps to reproduce

Look at the following test pages which demonstrate the problem:

Actual result

In Brave, we only look at the first value and use that. The header takes precedence.

Expected result

The Tor Browser merges all header values together (separated by ", " (without the quotes) and uses that as the URL. The <meta> tag takes precedence.

We should match the Tor browser since it is the de-facto reference implementation, but we should check upstream whether that's the intended behavior.

Reproduces how often

Always

Brave version (brave://version info)

Brave   1.68.110 Chromium: 127.0.6533.26 (Official Build) beta (64-bit) 
Revision    83a08b66c8afbf78547e2acc7b3a7ebb962f359b
OS  Linux

Channel information

fmarier commented 3 days ago

I have opened an issue upstream: https://gitlab.torproject.org/tpo/applications/tor-browser/-/issues/42688