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

Handle unexpected but valid JSON content-types #656

Merged
merged 3 commits into from
Jul 25, 2024

Conversation

brunoocasali
Copy link
Member

Pull Request

Related issue

When using Meilisearch analytics aka (meilisearch edge) users were facing weird decoding issues using this SDK.

I found the reason was some particular routes on the edge were responding a valid body but they contained a content-type that was not recognized as valid by this SDK application/json; charset=utf-8.

What does this PR do?

  • Handle this use case
  • Add a test to cover the new behavior

@brunoocasali brunoocasali requested a review from curquiza July 23, 2024 16:30
@brunoocasali brunoocasali added the bug Something isn't working label Jul 23, 2024
@brunoocasali brunoocasali force-pushed the bug/edge-content-type branch from 114addf to 9e766fd Compare July 23, 2024 16:42
@brunoocasali brunoocasali requested a review from norkunas July 24, 2024 10:22
Copy link
Collaborator

@norkunas norkunas left a comment

Choose a reason for hiding this comment

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

ok for merge, just no need for preg_match

src/Http/Client.php Outdated Show resolved Hide resolved
brunoocasali and others added 2 commits July 25, 2024 07:41
Co-authored-by: Tomas Norkūnas <norkunas.tom@gmail.com>
@brunoocasali brunoocasali requested a review from norkunas July 25, 2024 15:16
Copy link
Member

@curquiza curquiza left a comment

Choose a reason for hiding this comment

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

bors merge

@meili-bors meili-bors bot merged commit 9215471 into main Jul 25, 2024
28 checks passed
@meili-bors meili-bors bot deleted the bug/edge-content-type branch July 25, 2024 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants