mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-07 03:38:31 +00:00
Improve redbean docs (#249)
- Add Location to ProgramHeader exclusions - Add ProgramHeader documentation - Update ProgramRedirect to check location validity
This commit is contained in:
parent
a63b147a93
commit
7341336b1a
2 changed files with 34 additions and 15 deletions
|
@ -750,6 +750,12 @@ static void ProgramRedirect(int code, const char *sp, size_t sn, const char *dp,
|
|||
fprintf(stderr, "error: unsupported redirect code %d\n", code);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (!(FreeLater(EncodeHttpHeaderValue(dp, dn, 0)))) {
|
||||
fprintf(stderr, "error: invalid location %s\n", dp);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
r.code = code;
|
||||
r.path.s = sp;
|
||||
r.path.n = sn;
|
||||
|
@ -928,6 +934,7 @@ static void ProgramHeader(const char *s) {
|
|||
case kHttpContentLength:
|
||||
case kHttpContentEncoding:
|
||||
case kHttpContentRange:
|
||||
case kHttpLocation:
|
||||
fprintf(stderr, "error: can't program header: %`'s\n", s);
|
||||
exit(1);
|
||||
case kHttpServer:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue