Dolda2000 GitWeb
/
ashd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
0e57e1f
)
Trim any X-Ash- headers sent by the client.
author
Fredrik Tolf
<fredrik@dolda2000.com>
Tue, 24 Aug 2010 15:38:39 +0000
(17:38 +0200)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Tue, 24 Aug 2010 15:38:39 +0000
(17:38 +0200)
src/htparser.c
patch
|
blob
|
blame
|
history
diff --git
a/src/htparser.c
b/src/htparser.c
index
f489b2c
..
3fcca75
100644
(file)
--- a/
src/htparser.c
+++ b/
src/htparser.c
@@
-38,6
+38,23
@@
static int plex;
static int plex;
+static void trimx(struct hthead *req)
+{
+ int i;
+
+ i = 0;
+ while(i < req->noheaders) {
+ if(!strncasecmp(req->headers[i][0], "x-ash-", 6)) {
+ free(req->headers[i][0]);
+ free(req->headers[i][1]);
+ free(req->headers[i]);
+ memmove(req->headers + i, req->headers + i + 1, sizeof(*req->headers) * (--req->noheaders - i));
+ } else {
+ i++;
+ }
+ }
+}
+
static struct hthead *parsereq(FILE *in)
{
struct hthead *req;
static struct hthead *parsereq(FILE *in)
{
struct hthead *req;
@@
-85,6
+102,7
@@
static struct hthead *parsereq(FILE *in)
req = mkreq(method.b, url.b, ver.b);
if(parseheaders(req, in))
goto fail;
req = mkreq(method.b, url.b, ver.b);
if(parseheaders(req, in))
goto fail;
+ trimx(req);
goto out;
fail:
goto out;
fail: