Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
android-components
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
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
The Tor Project
Applications
android-components
Commits
8267cb25
Unverified
Commit
8267cb25
authored
Oct 29, 2021
by
Matthew Finkel
Browse files
Options
Downloads
Patches
Plain Diff
Bug 40070: Temporarily redirect DW's v2 address to their new v3 address
parent
710d1e60
No related branches found
No related tags found
1 merge request
!77
Bug 40070: Temporarily redirect DW's v2 address to their new v3 address
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/GeckoEngineSession.kt
+20
-2
20 additions, 2 deletions
...lla/components/browser/engine/gecko/GeckoEngineSession.kt
with
20 additions
and
2 deletions
components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/GeckoEngineSession.kt
+
20
−
2
View file @
8267cb25
...
...
@@ -155,12 +155,28 @@ class GeckoEngineSession(
return
}
// Bug 40070: Temporarily redirect DW's v2 address to their new v3 address
val
currentHost
=
Uri
.
parse
(
url
).
host
logger
.
error
(
"loadUrl: url: "
+
url
)
logger
.
error
(
"loadUrl: URL hostname: "
+
currentHost
)
logger
.
error
(
"loadUrl: V2_DW hostname: "
+
V2_DW_ADDRESS
)
val
newUrl
=
if
(
currentHost
!=
null
&&
currentHost
.
endsWith
(
V2_DW_ADDRESS
))
{
logger
.
error
(
"loadUrl: Found DW v2 address"
)
val
newHost
=
currentHost
.
replace
(
V2_DW_ADDRESS
,
V3_DW_ADDRESS
)
url
.
replaceFirst
(
currentHost
,
newHost
)
}
else
{
url
}
logger
.
error
(
"loadUrl: new url: "
+
newUrl
)
if
(
initialLoad
)
{
initialLoadRequest
=
LoadRequest
(
u
rl
,
parent
,
flags
,
additionalHeaders
)
initialLoadRequest
=
LoadRequest
(
newU
rl
,
parent
,
flags
,
additionalHeaders
)
}
val
loader
=
GeckoSession
.
Loader
()
.
uri
(
u
rl
)
.
uri
(
newU
rl
)
.
flags
(
flags
.
value
)
if
(
additionalHeaders
!=
null
)
{
...
...
@@ -1092,6 +1108,8 @@ class GeckoEngineSession(
internal
const
val
MOZ_NULL_PRINCIPAL
=
"moz-nullprincipal:"
internal
const
val
ABOUT_BLANK
=
"about:blank"
internal
val
BLOCKED_SCHEMES
=
listOf
(
"content"
,
"file"
,
"resource"
)
// See 1684761 and 1684947
internal
const
val
V2_DW_ADDRESS
=
"dwnewsvdyyiamwnp.onion"
internal
const
val
V3_DW_ADDRESS
=
"dwnewsgngmhlplxy6o2twtfgjnrnjxbegbwqx6wnotdhkzt562tszfid.onion"
/**
* Provides an ErrorType corresponding to the error code provided.
...
...
This diff is collapsed.
Click to expand it.
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