From d3ecee55bdfec0eec35b50b07ab830ad9535644d Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 21 Jan 2014 11:42:25 +0100 Subject: [PATCH] Remove #fragment for HTTP request encoding YAZ-730 --- src/http.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/http.c b/src/http.c index 0f17df5..54521b1 100644 --- a/src/http.c +++ b/src/http.c @@ -610,11 +610,13 @@ int yaz_encode_http_response(ODR o, Z_HTTP_Response *hr) int yaz_encode_http_request(ODR o, Z_HTTP_Request *hr) { Z_HTTP_Header *h; + char *cp; int top0 = o->op->top; odr_write(o, hr->method, strlen(hr->method)); odr_write(o, " ", 1); - odr_write(o, hr->path, strlen(hr->path)); + cp = strchr(hr->path, '#'); + odr_write(o, hr->path, cp ? (cp - hr->path) : strlen(hr->path)); odr_write(o, " HTTP/", 6); odr_write(o, hr->version, strlen(hr->version)); odr_write(o, "\r\n", 2); -- 1.7.10.4