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: No "content-type: application/json" in json on "token" endpoint resposes makes some clients fail, like "discourse" #13

Closed
raimon-segura opened this issue Jun 16, 2023 · 4 comments
Labels
bug Something isn't working
Milestone

Comments

@raimon-segura
Copy link

What steps will reproduce the problem?

Make a request to yii oauth2 endpoint

What is the expected result?

The response should has a content-type set to "application/json"

What do you get instead?

For now I've added a hack inside discourse source files

I'm thinking to add that "content-type" to Controllers & Action source files.. any hint to start?

Many Thanks!

@raimon-segura raimon-segura changed the title BUG: No "content-type: application/json" in json on "token" endpoint resposes mess makes some clients fail, like "discourse" BUG: No "content-type: application/json" in json on "token" endpoint resposes makes some clients fail, like "discourse" Jun 16, 2023
rhertogh added a commit that referenced this issue Jun 17, 2023
…t `Content-Type: application/json; charset=UTF-8` headers
@rhertogh rhertogh added this to the 1.0.0-alpha13 milestone Jun 17, 2023
@rhertogh rhertogh added the bug Something isn't working label Jun 17, 2023
@rhertogh
Copy link
Owner

@raimon-segura Hi, the default Yii Response overwrote the Content-Type header. This should now be fixed in \rhertogh\Yii2Oauth2Server\helpers\Psr7Helper::psr7ToYiiResponse() by setting the Response::$format to 'raw'.
Could you please confirm the issue is fixed in the latest dev-master version?

@raimon-segura
Copy link
Author

Hi @rhertogh ! ,

The Content-Type header works perfect! ...Also, I've seen you made other updates, all works as expected!

By the way, I'm using Moodle & Discourse.

Many thanks for your great work!

raimon.

@rhertogh
Copy link
Owner

@raimon-segura FYI: Released as 1.0.0-alpha13

@raimon-segura
Copy link
Author

raimon-segura commented Jun 19, 2023 via email

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

No branches or pull requests

2 participants