Skip to content

Commit 14f1cc7

Browse files
committed
Merge branch 'release/1.4.0' into main
2 parents dbb1d35 + 2f20d9f commit 14f1cc7

14 files changed

+125
-38
lines changed

.appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: "{build}"
1+
version: "1.4.0+{build}"
22

33
environment:
44
CTEST_OUTPUT_ON_FAILURE: '1'

.github/githubIssues.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
const searchForExistingGithubIssue = async ( { keywords, github, context } ) => {
3-
const query = keywords.concat( [ 'in:title', `repo:${context.payload.repository.full_name}`, 'type:issue' ] ).join( '+' );
3+
const query = keywords.concat( [ 'in:title', `repo:${context.repo.owner}/${context.repo.repo}`, 'type:issue' ] ).join( '+' );
44
const searchResponse = await github.search.issuesAndPullRequests( {
55
q: query,
66
} );

.github/workflows/checkForCodeUpdates.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- uses: actions/checkout@v2
1414
- uses: actions/setup-node@v1
1515
- run: npm install
16-
- uses: actions/github-script@v2
16+
- uses: actions/github-script@v4
1717
with:
1818
script: |
1919
const path = require( 'path' );
@@ -26,7 +26,7 @@ jobs:
2626
- uses: actions/checkout@v2
2727
- uses: actions/setup-node@v1
2828
- run: npm install
29-
- uses: actions/github-script@v2
29+
- uses: actions/github-script@v4
3030
with:
3131
script: |
3232
const path = require( 'path' );

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
!.appveyor.yml
44
!.travis.yml
55
!.github/
6+
!.release-it.json
67
build/
78
.build/
89
_build/
910
build_*/
10-
CMakeLists.txt.user
11+
CMakeLists.txt.user*
1112
package-lock.json
1213
node_modules/

.release-it.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"hooks": {
3+
"before:git:beforeBump": "git flow release start ${version}",
4+
"after:git:afterRelease": [
5+
"npx git-flow-silent-release ${version}",
6+
"git checkout develop"
7+
]
8+
},
9+
"git": {
10+
"tag": false,
11+
"push": false
12+
},
13+
"github": {
14+
"release": true,
15+
"web": true,
16+
"releaseName": "${version}"
17+
},
18+
"npm": {
19+
"publish": false
20+
},
21+
"plugins": {
22+
"@j-ulrich/release-it-regex-bumper": {
23+
"out": [
24+
"HttpStatusCodes_C.h",
25+
"HttpStatusCodes_C++.h",
26+
"HttpStatusCodes_C++11.h",
27+
"HttpStatusCodes_Qt.h",
28+
{
29+
"file": ".appveyor.yml",
30+
"search": "version: \".*\\+{build}\"",
31+
"replace": "version: \"{{version}}+{build}\""
32+
},
33+
{
34+
"file": "CHANGELOG.md",
35+
"search": "Unreleased",
36+
"replace": "[{{version}}] - {{now:yyyy-MM-dd}}"
37+
},
38+
{
39+
"file": "CHANGELOG.md",
40+
"search": "(\\[\\d+\\.\\d+\\.\\d+\\]: http)",
41+
"replace": "[{{version}}]: https://github.com/j-ulrich/http-status-codes-cpp/releases/tag/{{version}}\n$1"
42+
}
43+
]
44+
}
45+
}
46+
}

CHANGELOG.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,20 @@ This changelog follows the [Keep a Changelog](http://keepachangelog.com) format.
1010
---
1111

1212

13-
## Unreleased ##
13+
## [1.4.0] - 2021-11-05 ##
14+
Updates and adds missing status codes from the IANA registry.
1415

15-
### Changed ###
16+
### Added ###
17+
- [#17] Added codes `MisdirectedRequest` (421), `TooEarly` (425), `ContentTooLarge` (413) and `UnprocessableContent` (422).
18+
The existing codes `PayloadTooLarge` (413) and `UnprocessableEntity` (422) are kept for backward compatibility.
1619

20+
### Changed ###
1721
- [#12] Updated GTest to 1.8.1 to fix deprecation warnings with recent compilers.
22+
- [#17] Updated the reason phrases for `PayloadTooLarge` (413), `UnprocessableEntity` (422) and `GatewayTimeout` (504).
23+
24+
### Fixed ###
25+
- {C++11} Added missing `Code::xxx_max` enumerator.
26+
1827

1928

2029
---
@@ -50,7 +59,7 @@ This changelog follows the [Keep a Changelog](http://keepachangelog.com) format.
5059
Adds missing status codes from the IANA registry.
5160

5261
### Added ###
53-
- Status codes 103 Early Hints, 208 Already Reported, 508 Loop Detected and 510 Not Extended
62+
- Status codes `EarlyHints` (103), `AlreadyReported` (208), `LoopDetected` (508) and `NotExtended` (510).
5463

5564

5665
### Fixed ###
@@ -74,6 +83,7 @@ Initial (actually unversioned) release.
7483
---
7584

7685

86+
[1.4.0]: https://github.com/j-ulrich/http-status-codes-cpp/releases/tag/1.4.0
7787
[1.3.0]: https://github.com/j-ulrich/http-status-codes-cpp/releases/tag/1.3.0
7888
[1.2.0]: https://github.com/j-ulrich/http-status-codes-cpp/releases/tag/1.2.0
7989
[1.1.1]: https://github.com/j-ulrich/http-status-codes-cpp/releases/tag/1.1.1

HttpStatusCodes_C++.h

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* https://github.com/j-ulrich/http-status-codes-cpp
66
*
7-
* \version 1.3.0
7+
* \version 1.4.0
88
* \author Jochen Ulrich <[email protected]>
99
* \copyright Licensed under Creative Commons CC0 (http://creativecommons.org/publicdomain/zero/1.0/)
1010
*/
@@ -19,6 +19,7 @@
1919
namespace HttpStatus
2020
{
2121

22+
2223
/*! Enum for the HTTP status codes.
2324
*/
2425
enum Code
@@ -78,15 +79,19 @@ enum Code
7879
Gone = 410, //!< Indicates that access to the target resource is no longer available at the origin server and that this condition is likely to be permanent.
7980
LengthRequired = 411, //!< Indicates that the server refuses to accept the request without a defined Content-Length.
8081
PreconditionFailed = 412, //!< Indicates that one or more preconditions given in the request header fields evaluated to false when tested on the server.
81-
PayloadTooLarge = 413, //!< Indicates that the server is refusing to process a request because the request payload is larger than the server is willing or able to process.
82+
ContentTooLarge = 413, //!< Indicates that the server is refusing to process a request because the request payload is larger than the server is willing or able to process.
83+
PayloadTooLarge = 413, //!< Alias for ContentTooLarge for backward compatibility.
8284
URITooLong = 414, //!< Indicates that the server is refusing to service the request because the request-target is longer than the server is willing to interpret.
8385
UnsupportedMediaType = 415, //!< Indicates that the origin server is refusing to service the request because the payload is in a format not supported by the target resource for this method.
8486
RangeNotSatisfiable = 416, //!< Indicates that none of the ranges in the request's Range header field overlap the current extent of the selected resource or that the set of ranges requested has been rejected due to invalid ranges or an excessive request of small or overlapping ranges.
8587
ExpectationFailed = 417, //!< Indicates that the expectation given in the request's Expect header field could not be met by at least one of the inbound servers.
8688
ImATeapot = 418, //!< Any attempt to brew coffee with a teapot should result in the error code 418 I'm a teapot.
87-
UnprocessableEntity = 422, //!< Means the server understands the content type of the request entity (hence a 415(Unsupported Media Type) status code is inappropriate), and the syntax of the request entity is correct (thus a 400 (Bad Request) status code is inappropriate) but was unable to process the contained instructions.
89+
MisdirectedRequest = 421, //!< Indicates that the request was directed at a server that is unable or unwilling to produce an authoritative response for the target URI.
90+
UnprocessableContent = 422, //!< Means the server understands the content type of the request entity (hence a 415(Unsupported Media Type) status code is inappropriate), and the syntax of the request entity is correct (thus a 400 (Bad Request) status code is inappropriate) but was unable to process the contained instructions.
91+
UnprocessableEntity = 422, //!< Alias for UnprocessableContent for backward compatibility.
8892
Locked = 423, //!< Means the source or destination resource of a method is locked.
8993
FailedDependency = 424, //!< Means that the method could not be performed on the resource because the requested action depended on another action and that action failed.
94+
TooEarly = 425, //!< Indicates that the server is unwilling to risk processing a request that might be replayed.
9095
UpgradeRequired = 426, //!< Indicates that the server refuses to perform the request using the current protocol but might be willing to do so after the client upgrades to a different protocol.
9196
PreconditionRequired = 428, //!< Indicates that the origin server requires the request to be conditional.
9297
TooManyRequests = 429, //!< Indicates that the user has sent too many requests in a given amount of time (\"rate limiting\").
@@ -171,15 +176,17 @@ inline std::string reasonPhrase(int code)
171176
case 410: return "Gone";
172177
case 411: return "Length Required";
173178
case 412: return "Precondition Failed";
174-
case 413: return "Payload Too Large";
179+
case 413: return "Content Too Large";
175180
case 414: return "URI Too Long";
176181
case 415: return "Unsupported Media Type";
177182
case 416: return "Range Not Satisfiable";
178183
case 417: return "Expectation Failed";
179184
case 418: return "I'm a teapot";
180-
case 422: return "Unprocessable Entity";
185+
case 421: return "Misdirected Request";
186+
case 422: return "Unprocessable Content";
181187
case 423: return "Locked";
182188
case 424: return "Failed Dependency";
189+
case 425: return "Too Early";
183190
case 426: return "Upgrade Required";
184191
case 428: return "Precondition Required";
185192
case 429: return "Too Many Requests";
@@ -191,7 +198,7 @@ inline std::string reasonPhrase(int code)
191198
case 501: return "Not Implemented";
192199
case 502: return "Bad Gateway";
193200
case 503: return "Service Unavailable";
194-
case 504: return "Gateway Time-out";
201+
case 504: return "Gateway Timeout";
195202
case 505: return "HTTP Version Not Supported";
196203
case 506: return "Variant Also Negotiates";
197204
case 507: return "Insufficient Storage";

HttpStatusCodes_C++11.h

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* https://github.com/j-ulrich/http-status-codes-cpp
66
*
7-
* \version 1.3.0
7+
* \version 1.4.0
88
* \author Jochen Ulrich <[email protected]>
99
* \copyright Licensed under Creative Commons CC0 (http://creativecommons.org/publicdomain/zero/1.0/)
1010
*/
@@ -79,15 +79,19 @@ enum class Code
7979
Gone = 410, //!< Indicates that access to the target resource is no longer available at the origin server and that this condition is likely to be permanent.
8080
LengthRequired = 411, //!< Indicates that the server refuses to accept the request without a defined Content-Length.
8181
PreconditionFailed = 412, //!< Indicates that one or more preconditions given in the request header fields evaluated to false when tested on the server.
82-
PayloadTooLarge = 413, //!< Indicates that the server is refusing to process a request because the request payload is larger than the server is willing or able to process.
82+
ContentTooLarge = 413, //!< Indicates that the server is refusing to process a request because the request payload is larger than the server is willing or able to process.
83+
PayloadTooLarge = 413, //!< Alias for ContentTooLarge for backward compatibility.
8384
URITooLong = 414, //!< Indicates that the server is refusing to service the request because the request-target is longer than the server is willing to interpret.
8485
UnsupportedMediaType = 415, //!< Indicates that the origin server is refusing to service the request because the payload is in a format not supported by the target resource for this method.
8586
RangeNotSatisfiable = 416, //!< Indicates that none of the ranges in the request's Range header field overlap the current extent of the selected resource or that the set of ranges requested has been rejected due to invalid ranges or an excessive request of small or overlapping ranges.
8687
ExpectationFailed = 417, //!< Indicates that the expectation given in the request's Expect header field could not be met by at least one of the inbound servers.
8788
ImATeapot = 418, //!< Any attempt to brew coffee with a teapot should result in the error code 418 I'm a teapot.
88-
UnprocessableEntity = 422, //!< Means the server understands the content type of the request entity (hence a 415(Unsupported Media Type) status code is inappropriate), and the syntax of the request entity is correct (thus a 400 (Bad Request) status code is inappropriate) but was unable to process the contained instructions.
89+
MisdirectedRequest = 421, //!< Indicates that the request was directed at a server that is unable or unwilling to produce an authoritative response for the target URI.
90+
UnprocessableContent = 422, //!< Means the server understands the content type of the request entity (hence a 415(Unsupported Media Type) status code is inappropriate), and the syntax of the request entity is correct (thus a 400 (Bad Request) status code is inappropriate) but was unable to process the contained instructions.
91+
UnprocessableEntity = 422, //!< Alias for UnprocessableContent for backward compatibility.
8992
Locked = 423, //!< Means the source or destination resource of a method is locked.
9093
FailedDependency = 424, //!< Means that the method could not be performed on the resource because the requested action depended on another action and that action failed.
94+
TooEarly = 425, //!< Indicates that the server is unwilling to risk processing a request that might be replayed.
9195
UpgradeRequired = 426, //!< Indicates that the server refuses to perform the request using the current protocol but might be willing to do so after the client upgrades to a different protocol.
9296
PreconditionRequired = 428, //!< Indicates that the origin server requires the request to be conditional.
9397
TooManyRequests = 429, //!< Indicates that the user has sent too many requests in a given amount of time (\"rate limiting\").
@@ -109,6 +113,8 @@ enum class Code
109113
LoopDetected = 508, //!< Indicates that the server terminated an operation because it encountered an infinite loop while processing a request with "Depth: infinity". [RFC 5842]
110114
NotExtended = 510, //!< The policy for accessing the resource has not been met in the request. [RFC 2774]
111115
NetworkAuthenticationRequired = 511, //!< Indicates that the client needs to authenticate to gain network access.
116+
117+
xxx_max = 1023
112118
};
113119

114120
/*! Converts a Code to its corresponding integer value.
@@ -187,15 +193,17 @@ inline std::string reasonPhrase(int code)
187193
case 410: return "Gone";
188194
case 411: return "Length Required";
189195
case 412: return "Precondition Failed";
190-
case 413: return "Payload Too Large";
196+
case 413: return "Content Too Large";
191197
case 414: return "URI Too Long";
192198
case 415: return "Unsupported Media Type";
193199
case 416: return "Range Not Satisfiable";
194200
case 417: return "Expectation Failed";
195201
case 418: return "I'm a teapot";
196-
case 422: return "Unprocessable Entity";
202+
case 421: return "Misdirected Request";
203+
case 422: return "Unprocessable Content";
197204
case 423: return "Locked";
198205
case 424: return "Failed Dependency";
206+
case 425: return "Too Early";
199207
case 426: return "Upgrade Required";
200208
case 428: return "Precondition Required";
201209
case 429: return "Too Many Requests";
@@ -207,7 +215,7 @@ inline std::string reasonPhrase(int code)
207215
case 501: return "Not Implemented";
208216
case 502: return "Bad Gateway";
209217
case 503: return "Service Unavailable";
210-
case 504: return "Gateway Time-out";
218+
case 504: return "Gateway Timeout";
211219
case 505: return "HTTP Version Not Supported";
212220
case 506: return "Variant Also Negotiates";
213221
case 507: return "Insufficient Storage";

0 commit comments

Comments
 (0)