mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-06 09:50:28 +00:00
Add reset for redirect loop check in redbean Route
Without this reset a combination of RoutePath() and Route() calls could return "508 loop detected", since RoutePath could be called twice for the same redirected path. The protection against looping is still there, as it can only loop inside the Route() call (as it always serves something).
This commit is contained in:
parent
6e54e48e44
commit
8afc830355
1 changed files with 4 additions and 0 deletions
|
@ -5936,6 +5936,10 @@ static char *HandleRequest(void) {
|
|||
static char *Route(const char *host, size_t hostlen, const char *path,
|
||||
size_t pathlen) {
|
||||
char *p;
|
||||
// reset the redirect loop check, as it can only be looping inside
|
||||
// this function (as it always serves something); otherwise
|
||||
// successful RoutePath and Route may fail with "508 loop detected"
|
||||
loops.n = 0;
|
||||
if (logmessages) LogMessage("received", inbuf.p, hdrsize);
|
||||
if (hostlen && (p = RouteHost(host, hostlen, path, pathlen))) {
|
||||
return p;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue