Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate assertions in statuslookupgen to validate input
Although inputs to this function have to come from an enum that is generated by the same X-macro that is used to build the perfect hash table, anything could theoretically be passed to it if casted from an integer. So assert that the returned string actually matches the requested HTTP status code. (The lookup function wouldn't crash otherwise, but could return either a 999 Invalid code, or some code that is valid but has nothing to do with the requested code. Since this is just an assertion, this is mostly here to ensure that issues found during debugging are actually caught.)
- Loading branch information