From 0862bcc93d1f0b2214dc345da669f9dca5034c35 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Thu, 28 Jun 2012 14:32:09 +0200 Subject: [PATCH] webfs: send Accept headers --- sys/src/cmd/webfs/fs.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/src/cmd/webfs/fs.c b/sys/src/cmd/webfs/fs.c index ab21bce7a..5500be091 100644 --- a/sys/src/cmd/webfs/fs.c +++ b/sys/src/cmd/webfs/fs.c @@ -398,6 +398,13 @@ fsopen(Req *r) if(cl->request[0]) m = cl->request; + /* + * some sites give a 403 Forbidden if we dont include + * a meaningless Accept: */* header in the request. + */ + if(!lookkey(cl->hdr, "Accept")) + cl->hdr = addkey(cl->hdr, "Accept", "*/*"); + if(!lookkey(cl->hdr, "Referer")){ char *r; Url *u;