Remove size from public image ID JWT

This commit is contained in:
Deluan
2023-01-11 18:14:34 -05:00
committed by Deluan Quintão
parent 8f0d002922
commit 69e0a266f4
11 changed files with 150 additions and 87 deletions
+5 -1
View File
@@ -5,6 +5,7 @@ import (
"errors"
"fmt"
"net/http"
"net/url"
"path"
"strings"
"time"
@@ -137,10 +138,13 @@ func (s *Server) frontendAssetsHandler() http.Handler {
return r
}
func AbsoluteURL(r *http.Request, url string) string {
func AbsoluteURL(r *http.Request, url string, params url.Values) string {
if strings.HasPrefix(url, "/") {
appRoot := path.Join(r.Host, conf.Server.BaseURL, url)
url = r.URL.Scheme + "://" + appRoot
}
if len(params) > 0 {
url = url + "?" + params.Encode()
}
return url
}