projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use memcached factory function when available
[yaz-moved-to-github.git]
/
src
/
srwutil.c
diff --git
a/src/srwutil.c
b/src/srwutil.c
index
7be212a
..
cb00278
100644
(file)
--- a/
src/srwutil.c
+++ b/
src/srwutil.c
@@
-1052,6
+1052,7
@@
int yaz_sru_get_encode(Z_HTTP_Request *hreq, Z_SRW_PDU *srw_pdu,
char *name[MAX_SRU_PARAMETERS], *value[MAX_SRU_PARAMETERS]; /* definite upper limit for SRU params */
char *uri_args;
char *path;
char *name[MAX_SRU_PARAMETERS], *value[MAX_SRU_PARAMETERS]; /* definite upper limit for SRU params */
char *uri_args;
char *path;
+ char *cp;
z_HTTP_header_add_basic_auth(encode, &hreq->headers,
srw_pdu->username, srw_pdu->password);
z_HTTP_header_add_basic_auth(encode, &hreq->headers,
srw_pdu->username, srw_pdu->password);
@@
-1061,10
+1062,15
@@
int yaz_sru_get_encode(Z_HTTP_Request *hreq, Z_SRW_PDU *srw_pdu,
hreq->method = "GET";
hreq->method = "GET";
+ cp = strchr(hreq->path, '#');
+ if (cp)
+ *cp = '\0';
+
path = (char *)
odr_malloc(encode, strlen(hreq->path) + strlen(uri_args) + 4);
path = (char *)
odr_malloc(encode, strlen(hreq->path) + strlen(uri_args) + 4);
- sprintf(path, "%s?%s", hreq->path, uri_args);
+ sprintf(path, "%s%c%s", hreq->path, strchr(hreq->path, '?') ? '&' : '?',
+ uri_args);
hreq->path = path;
z_HTTP_header_add_content_type(encode, &hreq->headers,
hreq->path = path;
z_HTTP_header_add_content_type(encode, &hreq->headers,