summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@gmx.de>2013-05-26 03:33:39 +0200
committercinap_lenrek <cinap_lenrek@gmx.de>2013-05-26 03:33:39 +0200
commitef5e19b9be94b07ac68711255d87a7e5b31a65a4 (patch)
tree34f9d484f04ae7bb311ae7f9b16d78613c77b43d /sys
parent257c7e958ef125ec12cc218519ce56f767eb112d (diff)
add leading dot for explicit domain in webcookies, bump redirection limit to 12 in webfs
Diffstat (limited to 'sys')
-rw-r--r--sys/src/cmd/webcookies.c15
-rw-r--r--sys/src/cmd/webfs/http.c2
2 files changed, 14 insertions, 3 deletions
diff --git a/sys/src/cmd/webcookies.c b/sys/src/cmd/webcookies.c
index 45ff69550..b0508b309 100644
--- a/sys/src/cmd/webcookies.c
+++ b/sys/src/cmd/webcookies.c
@@ -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;
diff --git a/sys/src/cmd/webfs/http.c b/sys/src/cmd/webfs/http.c
index ecc2dde83..03029bb6a 100644
--- a/sys/src/cmd/webfs/http.c
+++ b/sys/src/cmd/webfs/http.c
@@ -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");