Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
persona
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hexang 息壤平台
persona
Commits
f8a027fe
Commit
f8a027fe
authored
12 years ago
by
Lloyd Hilaiel
Browse files
Options
Downloads
Patches
Plain Diff
route requests with verifier hostname directly to verifier
parent
38f710ff
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/router
+11
-1
11 additions, 1 deletion
bin/router
with
11 additions
and
1 deletion
bin/router
+
11
−
1
View file @
f8a027fe
...
...
@@ -87,8 +87,18 @@ if (config.get('scheme') == 'https') {
// redirect requests to the "verifier" processes
if
(
config
.
get
(
'
verifier_url
'
))
{
var
verifier_url
=
urlparse
(
config
.
get
(
'
verifier_url
'
)).
validate
().
normalize
();
// support requests coming into the verifier hostname as well as those with /verify in the path,
// iff the verifier is configured explicitly with a distinct hostname
var
verifier_host
;
if
(
config
.
get
(
'
public_verifier_url
'
)
!==
config
.
get
(
'
public_url
'
))
{
verifier_host
=
urlparse
(
config
.
get
(
'
public_verifier_url
'
)).
validate
().
host
;
}
app
.
use
(
function
(
req
,
res
,
next
)
{
if
(
/^
\/
verify$/
.
test
(
req
.
url
))
{
if
(
/^
\/
verify$/
.
test
(
req
.
url
)
||
(
req
.
headers
.
host
&&
verifier_host
&&
req
.
headers
.
host
===
verifier_host
))
{
forward
(
verifier_url
,
req
,
res
,
function
(
err
)
{
...
...
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