Compare commits
2 Commits
v1.0.1
..
4993d6e05d
| Author | SHA1 | Date | |
|---|---|---|---|
| 4993d6e05d | |||
|
8906cd9678
|
@@ -3,10 +3,8 @@ name: build
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- '**'
|
||||
tags:
|
||||
- '**'
|
||||
branches-ignore:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
Go-Build:
|
||||
|
||||
@@ -2,8 +2,8 @@ name: docker
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '**'
|
||||
branches:
|
||||
- 'main'
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
|
||||
@@ -104,9 +104,18 @@ func getPublicUrl(r *http.Request, subpath string) string {
|
||||
Host: r.Host,
|
||||
Path: path.Join("public", subpath),
|
||||
}
|
||||
newURL.Scheme = "http"
|
||||
if r.TLS != nil {
|
||||
newURL.Scheme = "https"
|
||||
}
|
||||
newURL.Scheme = determineScheme(r)
|
||||
return newURL.String()
|
||||
}
|
||||
|
||||
func determineScheme(r *http.Request) string {
|
||||
if proto := r.Header.Get("X-Forwarded-Proto"); proto != "" {
|
||||
return proto
|
||||
}
|
||||
|
||||
if r.TLS != nil {
|
||||
return "https"
|
||||
}
|
||||
|
||||
return "http"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user