diff options
author | Chocobozzz <me@florianbigard.com> | 2018-05-18 11:02:40 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-05-22 09:17:20 +0200 |
commit | cd4d7a2ca868209fb1e2dbd790c1e5d6cca77e86 (patch) | |
tree | a8d9e219c893551f669a3de37ae0ee91a6c0f7cd /client/src/app/shared/misc | |
parent | b4e5942ca79b8f5702c80197ec40eab8fa053a24 (diff) | |
download | PeerTube-cd4d7a2ca868209fb1e2dbd790c1e5d6cca77e86.tar.gz PeerTube-cd4d7a2ca868209fb1e2dbd790c1e5d6cca77e86.tar.zst PeerTube-cd4d7a2ca868209fb1e2dbd790c1e5d6cca77e86.zip |
Fix peertube with google bot
Diffstat (limited to 'client/src/app/shared/misc')
-rw-r--r-- | client/src/app/shared/misc/utils.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/client/src/app/shared/misc/utils.ts b/client/src/app/shared/misc/utils.ts index b9aa223cf..79c93c1b3 100644 --- a/client/src/app/shared/misc/utils.ts +++ b/client/src/app/shared/misc/utils.ts | |||
@@ -55,6 +55,15 @@ function immutableAssign <A, B> (target: A, source: B) { | |||
55 | return Object.assign({}, target, source) | 55 | return Object.assign({}, target, source) |
56 | } | 56 | } |
57 | 57 | ||
58 | function objectToUrlEncoded (obj: any) { | ||
59 | const str: string[] = [] | ||
60 | for (const key of Object.keys(obj)) { | ||
61 | str.push(encodeURIComponent(key) + '=' + encodeURIComponent(obj[key])) | ||
62 | } | ||
63 | |||
64 | return str.join('&') | ||
65 | } | ||
66 | |||
58 | // Thanks: https://gist.github.com/ghinda/8442a57f22099bdb2e34 | 67 | // Thanks: https://gist.github.com/ghinda/8442a57f22099bdb2e34 |
59 | function objectToFormData (obj: any, form?: FormData, namespace?: string) { | 68 | function objectToFormData (obj: any, form?: FormData, namespace?: string) { |
60 | let fd = form || new FormData() | 69 | let fd = form || new FormData() |
@@ -100,6 +109,7 @@ function isInMobileView () { | |||
100 | } | 109 | } |
101 | 110 | ||
102 | export { | 111 | export { |
112 | objectToUrlEncoded, | ||
103 | getParameterByName, | 113 | getParameterByName, |
104 | populateAsyncUserVideoChannels, | 114 | populateAsyncUserVideoChannels, |
105 | getAbsoluteAPIUrl, | 115 | getAbsoluteAPIUrl, |