Try getting scheme from X-Forwarded-Proto
1 files changed, 7 insertions(+), 1 deletions(-) M main.go
M main.go => main.go +7 -1
@@ 9,6 9,7 @@ import ( "math/rand" "net/http" "net/url" "strings" "time" "unicode" @@ 160,11 161,16 @@ func Bin(w http.ResponseWriter, r *http.Request, b *bitcask.Bitcask) { // return id u := url.URL{ Scheme: "http", Host: r.Host, Path: "/", // todo: use config or dynamic } if v, ok := r.Header["X-Forwarded-Proto"]; ok { u.Scheme = strings.Join(v, "") } else { u.Scheme = "http" } q := url.Values{} q.Set("id", id)