Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
TelcoDB
Web Frontend
Commits
d06f96ca
Verified
Commit
d06f96ca
authored
Dec 25, 2019
by
Elias Ojala
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return 404 if Tor relay does not exist
parent
e7826035
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
src/controllers/tor.controller.ts
src/controllers/tor.controller.ts
+11
-7
No files found.
src/controllers/tor.controller.ts
View file @
d06f96ca
...
...
@@ -33,13 +33,17 @@ router.get("/:fingerprint/", (req: Request, res: Response, next: NextFunction) =
.
then
(
x
=>
{
const
relayData
=
x
[
0
];
res
.
render
(
"
tor-relay/show.twig
"
,
{
"
canonical_url
"
:
`/tor-relay/
${
fingerprint
}
`
,
"
title
"
:
`Tor relay -
${
relayData
[
"
nickname
"
]}
`
,
"
description
"
:
`
${
relayData
[
"
nickname
"
]}
is a Tor relay hosted on
${
relayData
[
"
as
"
]}
${
relayData
[
"
as_name
"
]}
.`
,
"
data
"
:
relayData
,
"
json_data
"
:
JSON
.
stringify
(
relayData
,
null
,
2
),
});
if
(
relayData
===
undefined
)
{
next
();
}
else
{
res
.
render
(
"
tor-relay/show.twig
"
,
{
"
canonical_url
"
:
`/tor-relay/
${
fingerprint
}
`
,
"
title
"
:
`Tor relay -
${
relayData
[
"
nickname
"
]}
`
,
"
description
"
:
`
${
relayData
[
"
nickname
"
]}
is a Tor relay hosted on
${
relayData
[
"
as
"
]}
${
relayData
[
"
as_name
"
]}
.`
,
"
data
"
:
relayData
,
"
json_data
"
:
JSON
.
stringify
(
relayData
,
null
,
2
),
});
}
})
.
catch
(
next
);
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment