]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/src/cmd/webfs/fs.c
git/branch: somewhere in the syncing, the fix for junk files was lost
[plan9front.git] / sys / src / cmd / webfs / fs.c
index 27431b8bf8433cdbe2c6f521fad14d2cdd24b7b7..e4e08670daba7be2e4feda2f99bcd79cb3428360 100644 (file)
@@ -407,33 +407,6 @@ fsopen(Req *r)
                        if(!lookkey(cl->hdr, "Accept"))
                                cl->hdr = addkey(cl->hdr, "Accept", "*/*");
 
-                       if(!lookkey(cl->hdr, "Referer")){
-                               char *r;
-                               Url *u;
-
-                               /*
-                                * Referer header is often required on broken
-                                * websites even if the spec makes them optional,
-                                * so we make one up.
-                                */
-                               if(u = url("/", cl->url)){
-                                       if(r = u->host){
-                                               u->host = smprint("%N", r);
-                                               free(r);
-                                       }
-
-                                       /* do not send credentials */
-                                       free(u->user); u->user = nil;
-                                       free(u->pass); u->pass = nil;
-
-                                       if(r = smprint("%U", u)){
-                                               cl->hdr = addkey(cl->hdr, "Referer", r);
-                                               free(r);
-                                       }
-                                       freeurl(u);
-                               }
-                       }
-
                        if(!lookkey(cl->hdr, "Connection"))
                                cl->hdr = addkey(cl->hdr, "Connection", "keep-alive");
 
@@ -793,6 +766,7 @@ main(int argc, char *argv[])
        quotefmtinstall();
        fmtinstall('U', Ufmt);
        fmtinstall('N', Nfmt);
+       fmtinstall(']', Mfmt);
        fmtinstall('E', Efmt);
        fmtinstall('[', encodefmt);
        fmtinstall('H', encodefmt);