diff options
| author | Acid Chicken (硫酸鶏) <root@acid-chicken.com> | 2019-02-13 23:45:35 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-02-13 23:45:35 +0900 |
| commit | 4b6c11325158b7c2410b4fd940b6bec986341588 (patch) | |
| tree | bf843fe9af081329bc6cd83aed4c1e4682311d1c /src/client/app/common/scripts | |
| parent | Fix tslint.json styles (#4219) (diff) | |
| download | misskey-4b6c11325158b7c2410b4fd940b6bec986341588.tar.gz misskey-4b6c11325158b7c2410b4fd940b6bec986341588.tar.bz2 misskey-4b6c11325158b7c2410b4fd940b6bec986341588.zip | |
Add prelude function for URL Query (#4135)
* Update string.ts
* Refactor
* Update string.ts
* Update wrap-url.ts
* Update string.ts
* Update get-static-image-url.ts
* Use querystring.stringify
* Update outbox.ts
* Back to the urlQuery
* Update followers.ts
* Update following.ts
* Update outbox.ts
* Update string.ts
* Update get-static-image-url.ts
* Update string.ts
* Update string.ts
* Separate prelude files
Diffstat (limited to 'src/client/app/common/scripts')
| -rw-r--r-- | src/client/app/common/scripts/get-static-image-url.ts | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/client/app/common/scripts/get-static-image-url.ts b/src/client/app/common/scripts/get-static-image-url.ts index f84adf709c..7460ca38f2 100644 --- a/src/client/app/common/scripts/get-static-image-url.ts +++ b/src/client/app/common/scripts/get-static-image-url.ts @@ -1,9 +1,11 @@ import { url as instanceUrl } from '../../config'; +import * as url from '../../../../prelude/url'; -export function getStaticImageUrl(url: string): string { - const u = new URL(url); +export function getStaticImageUrl(baseUrl: string): string { + const u = new URL(baseUrl); const dummy = `${u.host}${u.pathname}`; // 拡張子がないとキャッシュしてくれないCDNがあるので - let result = `${instanceUrl}/proxy/${dummy}?url=${encodeURIComponent(u.href)}`; - result += '&static=1'; - return result; + return `${instanceUrl}/proxy/${dummy}?${url.query({ + url: u.href, + static: '1' + })}`; } |