add leading dot for explicit domain in webcookies, bump redirection limit to 12 in webfs
This commit is contained in:
parent
257c7e958e
commit
ef5e19b9be
2 changed files with 14 additions and 3 deletions
|
@ -953,9 +953,20 @@ parsecookie(Cookie *c, char *p, char **e, int isns, char *dom, char *path)
|
||||||
}
|
}
|
||||||
*e = p;
|
*e = p;
|
||||||
|
|
||||||
if(c->dom)
|
if(c->dom){
|
||||||
|
/* add leading dot for explicit domain */
|
||||||
|
if(c->dom[0] != '.' && strcmp(ipattr(c->dom), "dom") == 0){
|
||||||
|
static char *ddom = nil;
|
||||||
|
|
||||||
|
ddom = realloc(ddom, strlen(c->dom)+2);
|
||||||
|
if(ddom != nil){
|
||||||
|
ddom[0] = '.';
|
||||||
|
strcpy(ddom+1, c->dom);
|
||||||
|
c->dom = ddom;
|
||||||
|
}
|
||||||
|
}
|
||||||
c->explicitdom = 1;
|
c->explicitdom = 1;
|
||||||
else
|
}else
|
||||||
c->dom = dom;
|
c->dom = dom;
|
||||||
if(c->path)
|
if(c->path)
|
||||||
c->explicitpath = 1;
|
c->explicitpath = 1;
|
||||||
|
|
|
@ -506,7 +506,7 @@ http(char *m, Url *u, Key *shdr, Buq *qbody, Buq *qpost)
|
||||||
h = nil;
|
h = nil;
|
||||||
pid = 0;
|
pid = 0;
|
||||||
needlength = 0;
|
needlength = 0;
|
||||||
for(try = 0; try < 6; try++){
|
for(try = 0; try < 12; try++){
|
||||||
strcpy(status, "0 No status");
|
strcpy(status, "0 No status");
|
||||||
if(u == nil || (strcmp(u->scheme, "http") && strcmp(u->scheme, "https"))){
|
if(u == nil || (strcmp(u->scheme, "http") && strcmp(u->scheme, "https"))){
|
||||||
werrstr("bad url scheme");
|
werrstr("bad url scheme");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue