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
0340a177
Commit
0340a177
authored
13 years ago
by
Ben Adida
Browse files
Options
Downloads
Patches
Plain Diff
added custom 404 handlers for main site and verifier that do not echo the URL back in content
parent
c7495ab4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bin/browserid
+7
-0
7 additions, 0 deletions
bin/browserid
bin/verifier
+7
-0
7 additions, 0 deletions
bin/verifier
with
14 additions
and
0 deletions
bin/browserid
+
7
−
0
View file @
0340a177
...
...
@@ -168,6 +168,13 @@ shutdown.installUpdateHandler(app, function(readyForShutdown) {
db
.
close
(
readyForShutdown
)
});
// #11.5 - custom 404
app
.
use
(
function
(
req
,
res
,
next
)
{
res
.
statusCode
=
404
;
res
.
write
(
"
Cannot find this resource
"
);
res
.
end
();
});
// #12 if the BROWSERID_FAKE_VERIFICATION env var is defined, we'll include
// fake_verification.js. This is used during testing only and should
// never be included in a production deployment
...
...
This diff is collapsed.
Click to expand it.
bin/verifier
+
7
−
0
View file @
0340a177
...
...
@@ -123,6 +123,13 @@ app.post('/verify', function(req, resp, next) {
// shutdown when /code_update is invoked
shutdown
.
installUpdateHandler
(
app
);
// custom 404
app
.
use
(
function
(
req
,
res
,
next
)
{
res
.
statusCode
=
404
;
res
.
write
(
"
Cannot find this resource
"
);
res
.
end
();
});
// shutdown nicely on signals
shutdown
.
handleTerminationSignals
(
app
);
...
...
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