Closed Bug 1667471 Opened 5 years ago Closed 5 years ago

Expose a way to filter headers in loadUri

Categories

(GeckoView :: General, enhancement, P1)

Unspecified
All
enhancement

Tracking

(firefox83 fixed)

RESOLVED FIXED
83 Branch
Tracking Status
firefox83 --- fixed

People

(Reporter: agi, Assigned: agi)

References

Details

(Whiteboard: [geckoview:m83])

Attachments

(3 files)

Filtering headers for loadUri requests is error-prone and shouldn't be left to every app to implement.

We can provider some common filters that the embedder can use like CORS safelisted as argument.

Summary: Expose a way to filter headers → Expose a way to filter headers in loadUri
Assignee: nobody → agi

This introduces a new way of loading URIs in GeckoSession, using a builder-like
method loader() which deprecates the existing loadUri.

This change improves readability of long loadUri calls and allows us to add
more parameters without compromising usability.

It also fixes a bug where we were not short-circuiting the onLoadRequest call
in some cases.

This allows apps to modify the header filtering behavior, and introduces a safe
default (CORS safelisted).

Deprecated loadUri methods still maintain the old behavior so that we don't
inadvertently introduce bugs in apps.

Severity: -- → S3
Priority: -- → P1
Whiteboard: [geckoview:m83]
Pushed by asferro@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1453c6199311 Expose IsCORSSafelistedRequestHeader in WindowUtils. r=ckerschb https://hg.mozilla.org/integration/autoland/rev/f7642b4cb27a Add builder-like replacement for loadUri. r=snorp,owlish https://hg.mozilla.org/integration/autoland/rev/ab5779c59cca Add header filter to GeckoSession.loader. r=snorp,esawin
Pushed by asferro@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ad8b66ec5171 Expose IsCORSSafelistedRequestHeader in WindowUtils. r=ckerschb https://hg.mozilla.org/integration/autoland/rev/fdc015927934 Add builder-like replacement for loadUri. r=snorp,owlish https://hg.mozilla.org/integration/autoland/rev/cfd11957a8a0 Add header filter to GeckoSession.loader. r=snorp,esawin
Pushed by asferro@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/da7218c3e911 Expose IsCORSSafelistedRequestHeader in WindowUtils. r=ckerschb https://hg.mozilla.org/integration/autoland/rev/e607433d5ec5 Add builder-like replacement for loadUri. r=snorp,owlish https://hg.mozilla.org/integration/autoland/rev/ec225bf5041b Add header filter to GeckoSession.loader. r=snorp,esawin

Thanks!

Flags: needinfo?(agi)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: