Skip to content

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

adam-fowler
Copy link
Member

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

@adam-fowler adam-fowler requested a review from Joannis as a code owner June 1, 2025 15:03
Copy link

codecov bot commented Jun 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.35%. Comparing base (1f0f45f) to head (715c101).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@adam-fowler adam-fowler enabled auto-merge (squash) June 1, 2025 15:44
do {
try await asyncChannel.executeThenClose { _, outbound in
let headers: HTTPFields = [
.connection: "close",
.contentLength: "0",
]
let head = HTTPResponse(
status: .methodNotAllowed,
status: .ok,
Copy link
Member

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?

Copy link
Member Author

@adam-fowler adam-fowler Jun 1, 2025

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.

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