add leading dot for explicit domain in webcookies, bump redirection limit to 12 in webfs

This commit is contained in:
cinap_lenrek 2013-05-26 03:33:39 +02:00
parent 257c7e958e
commit ef5e19b9be
2 changed files with 14 additions and 3 deletions

View file

@ -953,9 +953,20 @@ parsecookie(Cookie *c, char *p, char **e, int isns, char *dom, char *path)
}
*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;
else
}else
c->dom = dom;
if(c->path)
c->explicitpath = 1;

View file

@ -506,7 +506,7 @@ http(char *m, Url *u, Key *shdr, Buq *qbody, Buq *qpost)
h = nil;
pid = 0;
needlength = 0;
for(try = 0; try < 6; try++){
for(try = 0; try < 12; try++){
strcpy(status, "0 No status");
if(u == nil || (strcmp(u->scheme, "http") && strcmp(u->scheme, "https"))){
werrstr("bad url scheme");