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

Add http 504 codes #367

Merged
merged 1 commit into from
Mar 20, 2022
Merged

Conversation

kingster
Copy link
Contributor

Adding these extra status codes. Without these entries, if returned crow returns default 500, error code.

@The-EDev
Copy link
Member

The-EDev commented Mar 20, 2022

Well, 208 was meant to be used with WebDAV, a technology Crow doesn't support. And AFAIK Crow doesn't have the proper mechanisms to return a 408 (Which shouldn't be something a Crow app manually reports). Can you elaborate on how you're using these 2 status codes?

@The-EDev
Copy link
Member

I should add that not returning a 408 isn't strictly in violation of the protocol.

@kingster
Copy link
Contributor Author

kingster commented Mar 20, 2022

Hmm, for 208, yes I agree, it's outside what crow supports today, so I could maybe use a better response code.

For 408, in my app, crow calls another service, and if that downstream service timeout, then it returns 408 as a response to the caller.

@The-EDev
Copy link
Member

For the second case I think returning a 500 might be more appropriate since The downstream service itself is returning 408 whereas the connection between the Crow app and the client could be fine.

@kingster
Copy link
Contributor Author

Agreed. Probably 504 makes more sense here. What do you think?

@The-EDev
Copy link
Member

The-EDev commented Mar 20, 2022

It does, and there's precedent in it being there since 502 Bad Gateway is there already.

@kingster kingster force-pushed the feature-additional-httpcodes branch from 0e0b214 to ee4ccf7 Compare March 20, 2022 17:53
@kingster kingster changed the title Add http 208 & 408 codes Add http 504 codes Mar 20, 2022
@kingster
Copy link
Contributor Author

Updated the PR with 504 code instead.

@The-EDev The-EDev merged commit b135ec6 into CrowCpp:master Mar 20, 2022
@The-EDev
Copy link
Member

Merged. Thank you for your help!

@kingster kingster deleted the feature-additional-httpcodes branch March 20, 2022 18:20
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.

2 participants