Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Only a subset of HTTP status codes is supported by the server #442

Open
@lyytinen

Description

@lyytinen

Only a subset of HTTP status codes is supported by the server. Looking at:

https://github.com/cpp-netlib/cpp-netlib/blob/0.11-devel/boost/network/protocol/http/impl/response.ipp

it appears that only few possible status lines are baked into the function that produces the buffer for this part of the response. The status_type enumeration itself contains all the standard status codes but in many cases that switch-case in the aforementioned function just defaults to 500 Internal Server Error.

I'm currently designing a REST API and as part of my optimistic concurrency control mechanism would like to return either 409 Conflict or 412 Precondition Failed in case the client tries to make updates to stale data. I don't think this is that unusual but currently it's not possible with the server. I've fixed this for myself in my fork:

https://github.com/lyytinen/cpp-netlib/blob/0.11-devel-missing-status-codes/boost/network/protocol/http/impl/response.ipp

Also, it seems suspicious that the version of the protocol is hard-coded into the status line constants. Should this not reflect the version the client actually requests? In my version I'm consistently using 1.1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp