Skip to content

Commit f17621d

Browse files
author
ethan
committed
https
1 parent 8daf08a commit f17621d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/AliOss.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ public function url($key, $rule = null)
8686
$append = $this->separator . $rule;
8787
}
8888

89-
return 'http://' . $this->bucket . '.' . $this->endPoint . '/' . $key . $append;
89+
$http = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off' ? 'https' : 'http';
90+
91+
return $http . '://' . $this->bucket . '.' . $this->endPoint . '/' . $key . $append;
9092
}
9193

9294
/**

0 commit comments

Comments
 (0)