Skip to content

Commit

Permalink
decode url params
Browse files Browse the repository at this point in the history
  • Loading branch information
Yi-Jacob committed May 18, 2024
1 parent e2a232e commit 4b73361
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/app/adf-api-docs/df-api-docs/df-api-docs.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,16 @@ export class DfApiDocsComponent implements OnInit, AfterContentInit {
domNode: this.apiDocElement?.nativeElement,
requestInterceptor: (req: SwaggerUI.Request) => {
req['headers'][SESSION_TOKEN_HEADER] = this.userDataService.token;
const url = new URL(req['url']);
const params = new URLSearchParams(url.search);
if (params.has('fields')) {
params.set(
'fields',
decodeURIComponent(params.get('fields')?.toString() || '')
);
url.search = params.toString();
req['url'] = url.toString();
}
return req;
},
showMutatedRequest: true,
Expand Down

0 comments on commit 4b73361

Please sign in to comment.