Commit 10d891d
authored
PLU-370: [CUSTOM-API-FIX-2] do not overwrite Content-Type (#823)
### TL;DR
Updated Custom API header handling to ensure:
* `Content-Type = application/json`, if not set by user
* `Content-Type` set in Connection step is not overwritten by `Content-Type` set in Custom Headers
### What changed?
- `Content-Type` header is now set for all requests to `application/json` instead of Axios' default `application/x-www-form-urlencoded`
### How to test?
1. Make a request to the custom API endpoint with no `Content-Type` set
2. Verify that the `Content-Type` header is present and is `application/json`
3. Create a Connection in **Add connection** step with a custom `Content-Type`
4. Verify that the `Content-Type` header is present and matches what was set
5. Add a different `Content-Type` to **Custom header** step
6. Verify that it does not overwrite the `Content-Type` set in the **Add connection** step
### Why make this change?
The Content-Type header should be set consistently for all requests. The previous implementation only set it for requests with headers specified in the Connection step.1 parent d3b6611 commit 10d891d
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | | - | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
0 commit comments