fix: Content-Type header added despite no request body defined in POST/PUT/PATCH endpoints
Addressed
https://github.com/stoplightio/elements/issues/2734
Changes
If no request body is defined, the Content-Type header should not be included.
Screenshot
Elements Default PR Template
In general, make sure you have: (check the boxes to acknowledge you've followed this template)
- [x] Read
CONTRIBUTING.md
Other Available PR Templates:
- Release: https://github.com/stoplightio/elements/compare?template=release.md
- [ ] Read the release section of
CONTRIBUTING.md
- [ ] Read the release section of
Deploy Preview for stoplight-elements-demo ready!
| Name | Link |
|---|---|
| Latest commit | 3c830a13f64a7b54a51d57ad45381ac546d57d84 |
| Latest deploy log | https://app.netlify.com/sites/stoplight-elements-demo/deploys/679ce87ba2c7810008624092 |
| Deploy Preview | https://deploy-preview-2739--stoplight-elements-demo.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Deploy Preview for stoplight-elements ready!
| Name | Link |
|---|---|
| Latest commit | 3c830a13f64a7b54a51d57ad45381ac546d57d84 |
| Latest deploy log | https://app.netlify.com/sites/stoplight-elements/deploys/679ce87b5fe0800008f20287 |
| Deploy Preview | https://deploy-preview-2739--stoplight-elements.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
I would greatly appreciate it if someone could review this. Thank you! CC @mnaumanali94
@nikrooz The code looks good, but if you want for these changes to be released after merging, you have to bump up versions in the proper package.json files. Please make sure to read our Versioning Gudelines.
cc. @mnaumanali94
@darekplawecki Thank you for your comments. I've updated the version; please let me know if there's anything else
~~On a different note, the e2e-react-cra is failing on the main branch due to type conflicts introduced by the release of React 19. I resolved this issue in my PR by adding a resolution for @types/react to the react-cra example.~~
Update: since the fix landed in main https://github.com/stoplightio/elements/pull/2750, I removed my fix commit in this PR
Hi team, any chance we can review this and get it merged. Thanks!
@darekplawecki Could you please take another look at this? I would greatly appreciate it, as our upcoming release is currently blocked by this fix.