diff --git a/src/app/views/common/share.ts b/src/app/views/common/share.ts index a73687dd1..75c096035 100644 --- a/src/app/views/common/share.ts +++ b/src/app/views/common/share.ts @@ -27,7 +27,7 @@ export const createShareLink = (sampleQuery: IQuery, authenticated?: boolean): s if (sampleBody && Object.keys(sampleBody).length > 0) { const requestBody = hashEncode(JSON.stringify(sampleBody)); - shareLink = `&requestBody=${requestBody}`; + shareLink = `${shareLink}&requestBody=${requestBody}`; } if (sampleHeaders && sampleHeaders.length > 0) { @@ -45,5 +45,5 @@ export const createShareLink = (sampleQuery: IQuery, authenticated?: boolean): s }; const hashEncode = (requestBody: string): string => { - return btoa(requestBody); -}; \ No newline at end of file + return btoa(unescape(encodeURIComponent(requestBody))); +}; diff --git a/src/app/views/query-runner/QueryInput.tsx b/src/app/views/query-runner/QueryInput.tsx index b3ca16b76..6440c4bc0 100644 --- a/src/app/views/query-runner/QueryInput.tsx +++ b/src/app/views/query-runner/QueryInput.tsx @@ -66,7 +66,7 @@ export class QueryInput extends Component { background: getStyleFor(selectedVerb), }; - const httpMethodsToDisplay = (mode === Mode.TryIt && !authenticated ) ? [httpMethods[0]] : httpMethods; + const httpMethodsToDisplay = (!authenticated) ? [httpMethods[0]] : httpMethods; return (