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
f6e98334
Commit
f6e98334
authored
Oct 09, 2023
by
Michael Yang
Browse files
handle upstream proxies
parent
ab066829
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
server/images.go
server/images.go
+12
-1
No files found.
server/images.go
View file @
f6e98334
...
@@ -1486,7 +1486,18 @@ func makeRequest(ctx context.Context, method string, requestURL *url.URL, header
...
@@ -1486,7 +1486,18 @@ func makeRequest(ctx context.Context, method string, requestURL *url.URL, header
req
.
ContentLength
=
contentLength
req
.
ContentLength
=
contentLength
}
}
resp
,
err
:=
http
.
DefaultClient
.
Do
(
req
)
proxyURL
,
err
:=
http
.
ProxyFromEnvironment
(
req
)
if
err
!=
nil
{
return
nil
,
err
}
client
:=
http
.
Client
{
Transport
:
&
http
.
Transport
{
Proxy
:
http
.
ProxyURL
(
proxyURL
),
},
}
resp
,
err
:=
client
.
Do
(
req
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
...
...
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