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(ResponseType): Correctly add empty responses for 204/304 #111

Merged
merged 1 commit into from
Apr 8, 2024

Conversation

provokateurin
Copy link
Member

Fixes #108

@provokateurin provokateurin force-pushed the fix/responsetype/empty-responses branch 2 times, most recently from 40f03d3 to eadd037 Compare April 8, 2024 12:35
src/ResponseType.php Outdated Show resolved Hide resolved
Copy link
Member

@nickvergessen nickvergessen left a comment

Choose a reason for hiding this comment

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

Would make the working more explicit

@provokateurin provokateurin force-pushed the fix/responsetype/empty-responses branch from eadd037 to 5ad8649 Compare April 8, 2024 13:03
@nickvergessen nickvergessen force-pushed the fix/responsetype/empty-responses branch from 5ad8649 to ca33281 Compare April 8, 2024 13:50
@nickvergessen
Copy link
Member

Rebased because it lost the automerge race

@provokateurin
Copy link
Member Author

Seems like the notification app has a problem: Endpoint#listNotifications: Custom headers are not allowed for responses with status code 204 or 304. Found: X-Nextcloud-User-Status

@provokateurin
Copy link
Member Author

Actually custom headers are just not allowed for 304, but 204 allows them. The error message in the server is wrong as well.

@provokateurin provokateurin force-pushed the fix/responsetype/empty-responses branch from d5b4913 to 608a037 Compare April 8, 2024 14:12
@provokateurin provokateurin merged commit ecf189d into main Apr 8, 2024
10 checks passed
@delete-merged-branch delete-merged-branch bot deleted the fix/responsetype/empty-responses branch April 8, 2024 14:19
/**
* A route 204 response
*
* @return DataResponse<Http::STATUS_NO_CONTENT, array<empty>, array{}>
Copy link
Member

Choose a reason for hiding this comment

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

could have added a header to sample/test it?

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

Successfully merging this pull request may close these issues.

Responses with 204 and 304 should be empty
2 participants