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

Fix HTTP request crash when the response does not contain a Content-Type header. #306

Merged
merged 1 commit into from
Mar 17, 2023

Conversation

alacoste
Copy link

Fixes: #305

@@ -153,7 +153,7 @@ class Requests implements Serializable {

Response response = handleRequest(connection)

if (response.headers?.'Content-Type'.contains('application/json')) {
if (response.headers?.'Content-Type'?.contains('application/json') == true) {
Copy link
Member

Choose a reason for hiding this comment

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

I see what I did wrong =/

@shadycuz
Copy link
Member

I thought only I used this code 👀. I think this makes you the first contributor! <3

Thanks for the fix, I just need to do a couple of things. But will try and get this officially released soon.

@alacoste
Copy link
Author

I thought only I used this code 👀. I think this makes you the first contributor! <3

Thanks for the fix, I just need to do a couple of things. But will try and get this officially released soon.

Sounds good, obviously feel free to edit this PR & merge it as you see fit :)

@shadycuz shadycuz changed the base branch from master to develop March 16, 2023 16:43
@shadycuz shadycuz added bug Something isn't working patch Bumps the patch version. labels Mar 16, 2023
@shadycuz shadycuz merged commit 95b5b10 into DontShaveTheYak:develop Mar 17, 2023
@alacoste alacoste deleted the patch-1 branch March 17, 2023 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working patch Bumps the patch version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HTTP request library fails internally if a HTTP response does not contain a 'Content-Type' header
2 participants