Skip to content

Commit

Permalink
fix: pass Content-Type header with its specific URI (#661)
Browse files Browse the repository at this point in the history
  • Loading branch information
bearn01d authored Mar 22, 2024
1 parent 7cdee3e commit f89053b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ the detailed section referring to by linking pull requests or issues.
- Asset: Fix double encoding of query params by disallowing '&' and '=' chars in
form field and sending them unencoded
- Fixed an issue that prevented custom headers from being included in HTTP Data Transfers
- Fix `Content-Type` header being ignored by backend for transfers

#### Deployment Migration Notes

Expand Down
11 changes: 7 additions & 4 deletions src/app/core/services/http-params-mapper.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,13 @@ export class HttpRequestParamsMapper {
),
[DataAddressProperty.proxyBody]: bool(httpRequestParams.proxyBody),
[DataAddressProperty.queryParams]: httpRequestParams.queryParams,
...mapKeys(
httpRequestParams.headers,
(k) => `${DataAddressProperty.header}:${k}`,
),
...mapKeys(httpRequestParams.headers, (k) => {
if (k.toLowerCase() === 'content-type') {
// this is required because the EDC sends the Content-Type header if and only if provided using the special field "contentType"
return DataAddressProperty.contentType;
}
return `${DataAddressProperty.header}:${k}`;
}),
};
return removeNullValues(props);
}
Expand Down

0 comments on commit f89053b

Please sign in to comment.