From: Adam Dickmeiss Date: Tue, 21 Jan 2014 10:42:25 +0000 (+0100) Subject: Remove #fragment for HTTP request encoding YAZ-730 X-Git-Tag: v5.0.12~4 X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=commitdiff_plain;h=d3ecee55bdfec0eec35b50b07ab830ad9535644d;hp=e83e1a41848ba1e54e2ba23e58f84ce91ed05927 Remove #fragment for HTTP request encoding YAZ-730 --- 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);