X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fhttp.c;fp=src%2Fhttp.c;h=54521b16a2eaeb0adf6ea650103fee034119d987;hp=0f17df533b598e5f505330ec4795afbb1d04e0ef;hb=d3ecee55bdfec0eec35b50b07ab830ad9535644d;hpb=e83e1a41848ba1e54e2ba23e58f84ce91ed05927 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);