Skip to content

Commit b5c7b90

Browse files
committed
added http status codes from RFC 2518 (WebDAV)
1 parent 773faaa commit b5c7b90

2 files changed

Lines changed: 18 additions & 4 deletions

File tree

include/crow/common.h

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ namespace crow
176176
NO_CONTENT = 204,
177177
RESET_CONTENT = 205,
178178
PARTIAL_CONTENT = 206,
179-
179+
WEBDAV_MULTI_STATUS = 207,
180180
MULTIPLE_CHOICES = 300,
181181
MOVED_PERMANENTLY = 301,
182182
FOUND = 302,
@@ -198,6 +198,13 @@ namespace crow
198198
UNSUPPORTED_MEDIA_TYPE = 415,
199199
RANGE_NOT_SATISFIABLE = 416,
200200
EXPECTATION_FAILED = 417,
201+
202+
WEBDAV_PRECONDITION_FAILED = 412,
203+
WEBDAV_REQUEST_URI_TOO_LONG = 414,
204+
WEBDAV_UNPROCESSABLE_ENTITY = 422,
205+
WEBDAV_LOCKED = 423,
206+
WEBDAV_FAILED_DEPENDENCY = 424,
207+
201208
PRECONDITION_REQUIRED = 428,
202209
TOO_MANY_REQUESTS = 429,
203210
UNAVAILABLE_FOR_LEGAL_REASONS = 451,
@@ -207,7 +214,8 @@ namespace crow
207214
BAD_GATEWAY = 502,
208215
SERVICE_UNAVAILABLE = 503,
209216
GATEWAY_TIMEOUT = 504,
210-
VARIANT_ALSO_NEGOTIATES = 506
217+
VARIANT_ALSO_NEGOTIATES = 506,
218+
WEBDAV_INSUFFICIENT_STORAGE = 507
211219
};
212220

213221
// clang-format on

include/crow/http_response.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ namespace crow
352352
{status::NO_CONTENT, "HTTP/1.1 204 No Content\r\n"},
353353
{status::RESET_CONTENT, "HTTP/1.1 205 Reset Content\r\n"},
354354
{status::PARTIAL_CONTENT, "HTTP/1.1 206 Partial Content\r\n"},
355-
355+
{status::WEBDAV_MULTI_STATUS, "HTTP/1.1 207 Multi-Status\r\n"},
356356
{status::MULTIPLE_CHOICES, "HTTP/1.1 300 Multiple Choices\r\n"},
357357
{status::MOVED_PERMANENTLY, "HTTP/1.1 301 Moved Permanently\r\n"},
358358
{status::FOUND, "HTTP/1.1 302 Found\r\n"},
@@ -374,6 +374,11 @@ namespace crow
374374
{status::UNSUPPORTED_MEDIA_TYPE, "HTTP/1.1 415 Unsupported Media Type\r\n"},
375375
{status::RANGE_NOT_SATISFIABLE, "HTTP/1.1 416 Range Not Satisfiable\r\n"},
376376
{status::EXPECTATION_FAILED, "HTTP/1.1 417 Expectation Failed\r\n"},
377+
{status::WEBDAV_PRECONDITION_FAILED, "HTTP/1.1 412 Precondition Failed\r\n"},
378+
{status::WEBDAV_REQUEST_URI_TOO_LONG, "HTTP/1.1 414 Request-URI Too Long\r\n"},
379+
{status::WEBDAV_UNPROCESSABLE_ENTITY, "HTTP/1.1 422 Unprocessable Entity\r\n"},
380+
{status::WEBDAV_LOCKED, "HTTP/1.1 423 Locked\r\n"},
381+
{status::WEBDAV_FAILED_DEPENDENCY, "HTTP/1.1 424 Failed Dependency\r\n"},
377382
{status::PRECONDITION_REQUIRED, "HTTP/1.1 428 Precondition Required\r\n"},
378383
{status::TOO_MANY_REQUESTS, "HTTP/1.1 429 Too Many Requests\r\n"},
379384
{status::UNAVAILABLE_FOR_LEGAL_REASONS, "HTTP/1.1 451 Unavailable For Legal Reasons\r\n"},
@@ -384,7 +389,8 @@ namespace crow
384389
{status::SERVICE_UNAVAILABLE, "HTTP/1.1 503 Service Unavailable\r\n"},
385390
{status::GATEWAY_TIMEOUT, "HTTP/1.1 504 Gateway Timeout\r\n"},
386391
{status::VARIANT_ALSO_NEGOTIATES, "HTTP/1.1 506 Variant Also Negotiates\r\n"},
387-
};
392+
{status::WEBDAV_INSUFFICIENT_STORAGE, "HTTP/1.1 507 Insufficient Storage\r\n"},
393+
};
388394

389395
static const std::string seperator = ": ";
390396

0 commit comments

Comments
 (0)