Closed Bug 1680332 Opened 3 years ago Closed 2 years ago

GeckoViewPushController::createScopeAndPrincipal doesn't split scopeAndPrincipal correctly

Categories

(GeckoView :: General, defect, P2)

Unspecified
All

Tracking

(firefox96 fixed)

RESOLVED FIXED
96 Branch
Tracking Status
firefox96 --- fixed

People

(Reporter: agi, Assigned: jonalmeida)

Details

(Keywords: good-first-bug, Whiteboard: [geckoview:m86])

Attachments

(1 file)

:nika pointed this out, from matrix:

nika: Super random thing, but I stumbled onto this code while reviewing some patches: https://searchfox.org/mozilla-central/rev/de782976bf97669f1e8edee59e7a2398154efe06/mobile/android/modules/geckoview/GeckoViewPushController.jsm#27
This split call is unfortunately wrong here. If you need to manually split originAttributes from the origin string you're supposed to do it by splitting on the rightmost ^ character, like is done here: https://searchfox.org/mozilla-central/rev/de782976bf97669f1e8edee59e7a2398154efe06/caps/OriginAttributes.cpp#355
I'm unsure this has any real impacts on anything, but figured I'd let y'all know :-)
You might have a better bet using createContentPrincipalFromOrigin(scopeAndAttrs) and then fetching back out the scope value using principal.URI.spec

Severity: -- → N/A
Priority: -- → P2
Whiteboard: [geckoview:m86]
Severity: N/A → S4
Keywords: good-first-bug
Assignee: nobody → jonalmeida942
Attachment #9251912 - Attachment description: WIP: Bug 1680332: Use createContentPrincipalFromOrigin to split scopeAndPrincipal → Bug 1680332: Use createContentPrincipalFromOrigin to split scopeAndPrincipal
Attachment #9251912 - Attachment description: Bug 1680332: Use createContentPrincipalFromOrigin to split scopeAndPrincipal → Bug 1680332 - Use createContentPrincipalFromOrigin to split scopeAndPrincipal r=agi,owlish
Pushed by jonalmeida942@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/55d2a0657f4c
Use createContentPrincipalFromOrigin to split scopeAndPrincipal r=geckoview-reviewers,agi
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 96 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: