Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dyndns-server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Schulcz Ferenc
dyndns-server
Commits
a8bf6383
Commit
a8bf6383
authored
1 year ago
by
Ferenc Schulcz
Browse files
Options
Downloads
Patches
Plain Diff
Add further sanitization
parent
42446e3d
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
middleware/registerMW.js
+1
-1
1 addition, 1 deletion
middleware/registerMW.js
middleware/updateMW.js
+8
-0
8 additions, 0 deletions
middleware/updateMW.js
with
9 additions
and
1 deletion
middleware/registerMW.js
+
1
−
1
View file @
a8bf6383
...
...
@@ -36,7 +36,7 @@ module.exports = function () {
const
domain
=
req
.
query
.
domain
;
const
format
=
/^
[
a-zA-Z0-9
\-]
*$/
;
if
(
!
format
.
test
(
domain
))
{
if
(
!
format
.
test
(
domain
)
||
domain
==
""
)
{
res
.
locals
.
statuscode
=
400
;
res
.
locals
.
answer
=
{
message
:
"
Domain name must only contain English letters, numbers and dash (-).
"
};
next
();
...
...
This diff is collapsed.
Click to expand it.
middleware/updateMW.js
+
8
−
0
View file @
a8bf6383
...
...
@@ -30,6 +30,14 @@ module.exports = function () {
const
token
=
req
.
query
.
token
;
const
ip
=
req
.
query
.
ip
;
const
format
=
/^
[
0-9.
]
*$/
;
if
(
!
format
.
test
(
ip
)
||
ip
==
""
)
{
res
.
locals
.
statuscode
=
400
;
res
.
locals
.
answer
=
{
message
:
"
Wrong IP format. Should be IPv4.
"
};
next
();
return
;
}
return
db
.
getDomain
(
token
)
.
catch
(()
=>
{
res
.
locals
.
statuscode
=
500
;
...
...
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