Skip to content

Add support for the 409 Conflict status code - #77

Merged
JackThomson2 merged 1 commit into
firecracker-microvm:mainfrom
EpicStep:feat/conflict-status-code
Jul 30, 2026
Merged

Add support for the 409 Conflict status code#77
JackThomson2 merged 1 commit into
firecracker-microvm:mainfrom
EpicStep:feat/conflict-status-code

Conversation

@EpicStep

@EpicStep EpicStep commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Reason for This PR

Cloud Hypervisor uses this crate for its HTTP API, and I want to answer some API
errors with 409 Conflict. StatusCode is a closed enum, so that is not possible
today.

Description of Changes

Add a Conflict variant to response::StatusCode and map it to b"409" in
StatusCode::raw(). The variant is placed after MethodNotAllowed to keep the
enum ordered by status code. Unit test extended accordingly.

License Acceptance

By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license.

PR Checklist

  • All commits in this PR are signed (git commit -s).
  • The reason for this PR is clearly provided (issue no. or explanation).
  • The description of changes is clear and encompassing.
  • Any required documentation changes (code and docs) are included in this PR.
  • Any newly added unsafe code is properly documented.
  • Any user-facing changes are mentioned in CHANGELOG.md.

Add a Conflict variant to the StatusCode enum so that responses can
report the 409 status code, and map it to its raw representation.

Signed-off-by: Stepan Rabotkin <epicstyt@gmail.com>
@EpicStep

Copy link
Copy Markdown
Contributor Author

@ShadowCurse @Manciukic @ilstam could you take a look at this PR when you get a chance? Happy to walk through anything that's unclear. Thanks!

@JackThomson2
JackThomson2 enabled auto-merge (rebase) July 29, 2026 20:38
@EpicStep

Copy link
Copy Markdown
Contributor Author

The doctest failure in CI here is unrelated to this change - it's the /tmp/example.sock race between the lib.rs and server.rs doctests, already being fixed in #76. Could you take a look at this PR when you get a chance?

@JackThomson2
JackThomson2 merged commit f2d9170 into firecracker-microvm:main Jul 30, 2026
2 checks passed
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.

3 participants