Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
757eeacc
Unverified
Commit
757eeacc
authored
Dec 10, 2024
by
frob
Committed by
GitHub
Dec 10, 2024
Browse files
server: lowercase hostname for Host header check (#5851)
parent
dd42acf7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
server/routes.go
server/routes.go
+3
-1
No files found.
server/routes.go
View file @
757eeacc
...
...
@@ -1071,11 +1071,13 @@ func isLocalIP(ip netip.Addr) bool {
}
func
allowedHost
(
host
string
)
bool
{
host
=
strings
.
ToLower
(
host
)
if
host
==
""
||
host
==
"localhost"
{
return
true
}
if
hostname
,
err
:=
os
.
Hostname
();
err
==
nil
&&
host
==
hostname
{
if
hostname
,
err
:=
os
.
Hostname
();
err
==
nil
&&
host
==
strings
.
ToLower
(
hostname
)
{
return
true
}
...
...
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