mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-23 00:47:31 +09:00
Issue #2736 - Part 1: Provide more consistent principals to CSP.
We're currently fairly vague and inconsistent about the values we provide to content policy implementations for requestOrigin and requestPrincipal. In some cases they're the triggering principal, sometimes the loading principal, sometimes the channel principal. Our existing content policy implementations which require or expect a loading principal currently retrieve it from the context node. Since no current callers require the principal to be the loading principal, and some already expect it to be the triggering principal (which there's currently no other way to retrieve), a choice was made to pass the triggering principal whenever possible, but use the loading principal to determine the origin URL.
This commit is contained in:
parent
422ca16a8e
commit
9ad680cfc4
18 changed files with 109 additions and 61 deletions
|
|
@ -34,8 +34,11 @@ interface nsIContentPolicy : nsIContentPolicyBase
|
|||
* not be null
|
||||
*
|
||||
* @param aRequestOrigin OPTIONAL. the location of the resource that
|
||||
* initiated this load request; can be null if
|
||||
* inapplicable
|
||||
* that is loading the request. This will generally
|
||||
* be the URI of the loading principal for the
|
||||
* resulting request (as determined by its
|
||||
* LoadInfo), but may vary depending on the
|
||||
* caller. Can be null if inapplicable.
|
||||
*
|
||||
* @param aContext OPTIONAL. the nsIDOMNode or nsIDOMWindow that
|
||||
* initiated the request, or something that can QI
|
||||
|
|
@ -55,8 +58,12 @@ interface nsIContentPolicy : nsIContentPolicyBase
|
|||
* @param aRequestPrincipal an OPTIONAL argument, defines the principal that
|
||||
* caused the load. This is optional only for
|
||||
* non-gecko code: all gecko code should set this
|
||||
* argument. For navigation events, this is
|
||||
* the principal of the page that caused this load.
|
||||
* argument. This should generally be the same as
|
||||
* the triggering principal for the resulting
|
||||
* request (as determined by its LoadInfo), but may
|
||||
* vary depending on the caller. Sometimes it will
|
||||
* be the loading principal or final channel
|
||||
* principal instead.
|
||||
*
|
||||
* @return ACCEPT or REJECT_*
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue