File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ func GuessCurrentHostURL(ctx context.Context) string {
7777 reqScheme := getRequestScheme (req )
7878 if reqScheme == "" {
7979 // if no reverse proxy header, try to use "Host" header for absolute URL
80- if setting .PublicURLGeneration == setting .PublicURLAuto && req .Host != "" {
80+ if setting .PublicURLDetection == setting .PublicURLAuto && req .Host != "" {
8181 return util .Iif (req .TLS == nil , "http://" , "https://" ) + req .Host
8282 }
8383 // fall back to default AppURL
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ func TestGuessCurrentHostURL(t *testing.T) {
4646 headersWithProto := http.Header {"X-Forwarded-Proto" : {"https" }}
4747
4848 t .Run ("Legacy" , func (t * testing.T ) {
49- defer test .MockVariableValue (& setting .PublicURLGeneration , setting .PublicURLLegacy )()
49+ defer test .MockVariableValue (& setting .PublicURLDetection , setting .PublicURLLegacy )()
5050
5151 assert .Equal (t , "http://cfg-host" , GuessCurrentHostURL (t .Context ()))
5252
@@ -60,7 +60,7 @@ func TestGuessCurrentHostURL(t *testing.T) {
6060 })
6161
6262 t .Run ("Auto" , func (t * testing.T ) {
63- defer test .MockVariableValue (& setting .PublicURLGeneration , setting .PublicURLAuto )()
63+ defer test .MockVariableValue (& setting .PublicURLDetection , setting .PublicURLAuto )()
6464
6565 assert .Equal (t , "http://cfg-host" , GuessCurrentHostURL (t .Context ()))
6666
You can’t perform that action at this time.
0 commit comments