Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor Browser
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
The Tor Project
Applications
Tor Browser
Commits
c43bf454
Commit
c43bf454
authored
Nov 4, 2020
by
Alex Catarineu
Committed by
Pier Angelo Vendrame
Jun 11, 2024
Browse files
Options
Downloads
Patches
Plain Diff
Bug 40171: Make WebRequest and GeckoWebExecutor First-Party aware
parent
cc0bf3a3
Branches
Branches containing commit
No related tags found
1 merge request
!1043
Bug 42616: Rebased alpha onto Firefox 128.0b1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/WebRequest.java
+18
-0
18 additions, 0 deletions
...oview/src/main/java/org/mozilla/geckoview/WebRequest.java
widget/android/WebExecutorSupport.cpp
+8
-0
8 additions, 0 deletions
widget/android/WebExecutorSupport.cpp
with
26 additions
and
0 deletions
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/WebRequest.java
+
18
−
0
View file @
c43bf454
...
...
@@ -49,6 +49,11 @@ public class WebRequest extends WebMessage {
/** The value of the Referer header for this request. */
public
final
@Nullable
String
referrer
;
/**
* The value of the origin of this request.
*/
public
final
@Nullable
String
origin
;
@Retention
(
RetentionPolicy
.
SOURCE
)
@IntDef
({
CACHE_MODE_DEFAULT
,
...
...
@@ -110,6 +115,7 @@ public class WebRequest extends WebMessage {
cacheMode
=
builder
.
mCacheMode
;
referrer
=
builder
.
mReferrer
;
beConservative
=
builder
.
mBeConservative
;
origin
=
builder
.
mOrigin
;
if
(
builder
.
mBody
!=
null
)
{
body
=
builder
.
mBody
.
asReadOnlyBuffer
();
...
...
@@ -125,6 +131,7 @@ public class WebRequest extends WebMessage {
/* package */
int
mCacheMode
=
CACHE_MODE_DEFAULT
;
/* package */
String
mReferrer
;
/* package */
boolean
mBeConservative
;
/* package */
String
mOrigin
;
/**
* Construct a Builder instance with the specified URI.
...
...
@@ -235,6 +242,17 @@ public class WebRequest extends WebMessage {
return
this
;
}
/**
* Set the origin URI.
*
* @param origin A URI String
* @return This Builder instance.
*/
public
@NonNull
Builder
origin
(
final
@Nullable
String
origin
)
{
mOrigin
=
origin
;
return
this
;
}
/**
* @return A {@link WebRequest} constructed with the values from this Builder instance.
*/
...
...
This diff is collapsed.
Click to expand it.
widget/android/WebExecutorSupport.cpp
+
8
−
0
View file @
c43bf454
...
...
@@ -405,6 +405,14 @@ nsresult WebExecutorSupport::CreateStreamLoader(
MOZ_ASSERT
(
cookieJarSettings
);
nsCOMPtr
<
nsILoadInfo
>
loadInfo
=
channel
->
LoadInfo
();
if
(
const
auto
origin
=
req
->
Origin
();
origin
)
{
RefPtr
<
nsIURI
>
originUri
;
rv
=
NS_NewURI
(
getter_AddRefs
(
originUri
),
origin
->
ToString
());
NS_ENSURE_SUCCESS
(
rv
,
NS_ERROR_MALFORMED_URI
);
OriginAttributes
attrs
=
loadInfo
->
GetOriginAttributes
();
attrs
.
SetFirstPartyDomain
(
true
,
originUri
);
loadInfo
->
SetOriginAttributes
(
attrs
);
}
loadInfo
->
SetCookieJarSettings
(
cookieJarSettings
);
// setup http/https specific things
...
...
This diff is collapsed.
Click to expand it.
Pier Angelo Vendrame
@pierov
mentioned in issue
#40789
·
Jul 11, 2024
mentioned in issue
#40789
mentioned in issue #40789
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment