From cd4d7a2ca868209fb1e2dbd790c1e5d6cca77e86 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 18 May 2018 11:02:40 +0200 Subject: Fix peertube with google bot --- client/src/app/shared/misc/utils.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'client/src/app/shared') 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 (target: A, source: B) { return Object.assign({}, target, source) } +function objectToUrlEncoded (obj: any) { + const str: string[] = [] + for (const key of Object.keys(obj)) { + str.push(encodeURIComponent(key) + '=' + encodeURIComponent(obj[key])) + } + + return str.join('&') +} + // Thanks: https://gist.github.com/ghinda/8442a57f22099bdb2e34 function objectToFormData (obj: any, form?: FormData, namespace?: string) { let fd = form || new FormData() @@ -100,6 +109,7 @@ function isInMobileView () { } export { + objectToUrlEncoded, getParameterByName, populateAsyncUserVideoChannels, getAbsoluteAPIUrl, -- cgit v1.2.3