Skip to content

Commit

Permalink
Fix key-value in additional params being reversed
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensworks committed Jul 13, 2022
1 parent 35938a1 commit d219ffd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/SparqlEndpointFetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ export class SparqlEndpointFetcher {
headers.append('Content-Type', 'application/x-www-form-urlencoded');
body = new URLSearchParams();
body.set('query', query);
this.additionalUrlParams.forEach((key: string, value: string) => {
this.additionalUrlParams.forEach((value: string, key: string) => {
body.set(key, value);
})
headers.append('Content-Length', body.toString().length.toString());
Expand Down
2 changes: 1 addition & 1 deletion test/SparqlEndpointFetcher-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ describe('SparqlEndpointFetcher', () => {
headers.append('Content-Length', '67');
const body = new URLSearchParams();
body.set('query', querySelect);
additionalUrlParams.forEach((key: string, value: string) => {
additionalUrlParams.forEach((value: string, key: string) => {
body.set(key, String(value));
})
return expect(fetchCbThis).toBeCalledWith(
Expand Down

0 comments on commit d219ffd

Please sign in to comment.