-
-
Notifications
You must be signed in to change notification settings - Fork 9
Write empty 200 response for failed upgrade #107
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #107 +/- ##
=======================================
Coverage 80.35% 80.35%
=======================================
Files 6 6
Lines 397 397
=======================================
Hits 319 319
Misses 78 78 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
do { | ||
try await asyncChannel.executeThenClose { _, outbound in | ||
let headers: HTTPFields = [ | ||
.connection: "close", | ||
.contentLength: "0", | ||
] | ||
let head = HTTPResponse( | ||
status: .methodNotAllowed, | ||
status: .ok, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this more of a 500
/ internalServerError
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not a 5xx as it isn't a server error. It is caused by the shouldUpgrade failing, which is client error. But the standard for an upgrading failing is 200. A successful upgrade returns a 101.
For some reason I was returning a 405 (Method Not Allowed) which doesn't make sense.
Looking around on the web it seems an empty 200 is the standard response for a failed upgrade