Skip to content

Commit 561f370

Browse files
committed
fix var name
1 parent 1947a48 commit 561f370

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

modules/httplib/url.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

modules/httplib/url_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)