File tree Expand file tree Collapse file tree 3 files changed +4
-1
lines changed Expand file tree Collapse file tree 3 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,8 @@ func TestIsRelativeURL(t *testing.T) {
4242
4343func TestGuessCurrentHostURL (t * testing.T ) {
4444 defer test .MockVariableValue (& setting .AppURL , "http://cfg-host/sub/" )()
45+ defer test .MockVariableValue (& setting .AppSubURL , "/sub" )()
46+ defer test .MockVariableValue (& setting .UseHostHeader , false )()
4547
4648 ctx := t .Context ()
4749 assert .Equal (t , "http://cfg-host" , GuessCurrentHostURL (ctx ))
Original file line number Diff line number Diff line change @@ -199,7 +199,7 @@ func loadServerFrom(rootCfg ConfigProvider) {
199199 }
200200
201201 switch protocolCfg {
202- case "http" :
202+ case "" , " http" :
203203 Protocol = HTTP
204204 case "https" :
205205 Protocol = HTTPS
Original file line number Diff line number Diff line change @@ -76,6 +76,7 @@ func TestShadowPassword(t *testing.T) {
7676func TestSelfCheckPost (t * testing.T ) {
7777 defer test .MockVariableValue (& setting .AppURL , "http://config/sub/" )()
7878 defer test .MockVariableValue (& setting .AppSubURL , "/sub" )()
79+ defer test .MockVariableValue (& setting .UseHostHeader , false )()
7980
8081 ctx , resp := contexttest .MockContext (t , "GET http://host/sub/admin/self_check?location_origin=http://frontend" )
8182 SelfCheckPost (ctx )
You can’t perform that action at this time.
0 commit comments