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

use specified status code for inertia response #15

Merged
merged 1 commit into from
Jul 12, 2023

Conversation

kohkimakimoto
Copy link
Owner

In the current implementation, the Inertia JSON response is always returned with an HTTP 200 status code. This process is based on the Inertia-Laravel implementation. You can see this here: see https://github.com/inertiajs/inertia-laravel/blob/af7571859cb643b206ff67083d47fb75cd7f26de/src/Response.php#L107

However, I believe it would be better to return different status codes under certain circumstances, such as a 404 error.

I have tested this and confirmed that the Inertia client-side library can accept status codes other than 200.

@kohkimakimoto kohkimakimoto merged commit 17f2ec1 into master Jul 12, 2023
1 check passed
@kohkimakimoto kohkimakimoto deleted the fix-error-status branch July 12, 2023 07:31
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.

None yet

1 participant