Skip to content

[Notifier] Add missing charset to content-type for Slack notifier #41211

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

Merged
merged 1 commit into from
May 13, 2021

Conversation

norkunas
Copy link
Contributor

Q A
Branch? 5.2
Bug fix? yes
New feature? no
Deprecations? no
Tickets N/A
License MIT
Doc PR N/A

Symfony HttpClient doesn't set charset for the Content-Type header when used with json request option so with each response slack includes:

"response_metadata" => array:1 [
  "warnings" => array:1 [
    0 => "missing_charset"
  ]
]

@OskarStark
Copy link
Contributor

@nicolas-grekas is this expected behavior of http client?

Copy link
Contributor

@OskarStark OskarStark left a comment

Choose a reason for hiding this comment

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

Could you please add a test case to avoid a regression in the future?

and maybe check other transports which are using the 'json' key?

@nicolas-grekas
Copy link
Member

Yes it is: application/json is an utf8-only content-type. The API is stupid...

@norkunas
Copy link
Contributor Author

Could you please add a test case to avoid a regression in the future?

and maybe check other transports which are using the 'json' key?

Will add a test.

I think this is specific only for slack, as by spec json must be in utf-8 so adding charset everywhere shouldn't be required.

@OskarStark
Copy link
Contributor

Fine thank you 👍🏻

Copy link
Contributor

@OskarStark OskarStark left a comment

Choose a reason for hiding this comment

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

After a test was added

@norkunas norkunas force-pushed the add-missing-charset-for-slack branch from 1de0473 to e642100 Compare May 13, 2021 08:16
@norkunas
Copy link
Contributor Author

After a test was added

Done ;)

@Nyholm
Copy link
Member

Nyholm commented May 13, 2021

Good catch, thanks Tomas.

@Nyholm Nyholm merged commit 35dbf8c into symfony:5.2 May 13, 2021
@norkunas norkunas deleted the add-missing-charset-for-slack branch May 13, 2021 09:59
This was referenced May 19, 2021
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.

5 participants