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
orangecat
ollama
Commits
a027a7dd
Commit
a027a7dd
authored
Aug 08, 2023
by
Jeffrey Morgan
Browse files
add `0.0.0.0` as an allowed origin by default
Fixes #282
parent
22986ccb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
server/routes.go
server/routes.go
+4
-1
No files found.
server/routes.go
View file @
a027a7dd
...
...
@@ -323,7 +323,6 @@ func CopyModelHandler(c *gin.Context) {
func
Serve
(
ln
net
.
Listener
,
extraOrigins
[]
string
)
error
{
config
:=
cors
.
DefaultConfig
()
config
.
AllowWildcard
=
true
// only allow http/https from localhost
allowedOrigins
:=
[]
string
{
"http://localhost"
,
"http://localhost:*"
,
...
...
@@ -333,6 +332,10 @@ func Serve(ln net.Listener, extraOrigins []string) error {
"http://127.0.0.1:*"
,
"https://127.0.0.1"
,
"https://127.0.0.1:*"
,
"http://0.0.0.0"
,
"http://0.0.0.0:*"
,
"https://0.0.0.0"
,
"https://0.0.0.0:*"
,
}
allowedOrigins
=
append
(
allowedOrigins
,
extraOrigins
...
)
config
.
AllowOrigins
=
allowedOrigins
...
...
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