Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4993d6e05d | |||
|
8906cd9678
|
@@ -3,10 +3,8 @@ name: build
|
|||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches-ignore:
|
||||||
- '**'
|
- main
|
||||||
tags:
|
|
||||||
- '**'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Go-Build:
|
Go-Build:
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ name: docker
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
branches:
|
||||||
- '**'
|
- 'main'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker:
|
docker:
|
||||||
|
|||||||
@@ -104,9 +104,18 @@ func getPublicUrl(r *http.Request, subpath string) string {
|
|||||||
Host: r.Host,
|
Host: r.Host,
|
||||||
Path: path.Join("public", subpath),
|
Path: path.Join("public", subpath),
|
||||||
}
|
}
|
||||||
newURL.Scheme = "http"
|
newURL.Scheme = determineScheme(r)
|
||||||
if r.TLS != nil {
|
|
||||||
newURL.Scheme = "https"
|
|
||||||
}
|
|
||||||
return newURL.String()
|
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