fix: force file urls to https
This commit is contained in:
@@ -58,6 +58,17 @@ func TestIsOSSObjectNotFound(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestNormalizeSignedRedirectURL(t *testing.T) {
|
||||
rawURL := "http://im-oss-t1.oss-cn-shenzhen.aliyuncs.com/tenants/1/avatar.jpg?Expires=1&OSSAccessKeyId=ak&Signature=sig"
|
||||
want := "https://im-oss-t1.oss-cn-shenzhen.aliyuncs.com/tenants/1/avatar.jpg?Expires=1&OSSAccessKeyId=ak&Signature=sig"
|
||||
if got := normalizeSignedRedirectURL(rawURL); got != want {
|
||||
t.Fatalf("normalizeSignedRedirectURL()=%q, want %q", got, want)
|
||||
}
|
||||
if got := normalizeSignedRedirectURL("/v0/file/s/avatar.jpg"); got != "/v0/file/s/avatar.jpg" {
|
||||
t.Fatalf("relative URL must be unchanged, got %q", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestLoadSysConfig(t *testing.T) {
|
||||
original := store.ThirdPartyConfig
|
||||
store.ThirdPartyConfig = fakeThirdPartyConfig{
|
||||
|
||||
Reference in New Issue
Block a user