Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug - Fix API Content-Type Header handling #15574

Merged
merged 3 commits into from Nov 14, 2023
Merged

Conversation

PipoCanaja
Copy link
Contributor

@PipoCanaja PipoCanaja commented Nov 13, 2023

fixes #15082

Laravel HTTP client does not handle Content-Type as we supposed. (https://laravel.com/docs/10.x/http-client). withBody() will always override the Content-Type. And even setting the Content-Type after withBody fails (we end up with 2 Content-Type).
array_merge, in the correct order, seems to solve the case in all the tests I ran.

DO NOT DELETE THE UNDERLYING TEXT

Please note

Please read this information carefully. You can run ./lnms dev:check to check your code before submitting.

  • Have you followed our code guidelines?
  • If my Pull Request does some changes/fixes/enhancements in the WebUI, I have inserted a screenshot of it.
  • If my Pull Request makes discovery/polling/yaml changes, I have added/updated test data.

Testers

If you would like to test this pull request then please run: ./scripts/github-apply <pr_id>, i.e ./scripts/github-apply 5926
After you are done testing, you can remove the changes with ./scripts/github-remove. If there are schema changes, you can ask on discord how to revert.

@PipoCanaja PipoCanaja self-assigned this Nov 13, 2023
Copy link
Member

@murrant murrant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@murrant murrant merged commit d107af1 into librenms:master Nov 14, 2023
8 checks passed
@librenms-bot
Copy link

This pull request has been mentioned on LibreNMS Community. There might be relevant details there:

https://community.librenms.org/t/23-11-0-changelog/22833/1

gdepeyrot pushed a commit to gdepeyrot/librenms that referenced this pull request Nov 29, 2023
* Fix API Content-Type Header

* compacted and commented

* style
gunkaaa pushed a commit to gunkaaa/librenms that referenced this pull request Jan 8, 2024
* Fix API Content-Type Header

* compacted and commented

* style
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API POST transports no longer set Content-type header properly.
3 participants