More fragment removal in SRU GET and Solr case YAZ-730
authorAdam Dickmeiss <adam@indexdata.dk>
Tue, 21 Jan 2014 12:44:19 +0000 (13:44 +0100)
committerAdam Dickmeiss <adam@indexdata.dk>
Tue, 21 Jan 2014 12:44:19 +0000 (13:44 +0100)
src/solr.c
src/srwutil.c

index e9d3dcf..99a9519 100644 (file)
@@ -583,6 +583,9 @@ int yaz_solr_encode_request(Z_HTTP_Request *hreq, Z_SRW_PDU *srw_pdu,
         odr_malloc(encode, strlen(hreq->path) +
                    strlen(uri_args) + strlen(solr_op) + 5);
 
+    cp = strchr(hreq->path, '#');
+    if (cp)
+        *cp = '\0';
     cp = strchr(hreq->path, '?');
     if (cp)
     {
index 017ec5e..cb00278 100644 (file)
@@ -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 *cp;
 
     z_HTTP_header_add_basic_auth(encode, &hreq->headers,
                                  srw_pdu->username, srw_pdu->password);
@@ -1061,6 +1062,10 @@ int yaz_sru_get_encode(Z_HTTP_Request *hreq, Z_SRW_PDU *srw_pdu,
 
     hreq->method = "GET";
 
+    cp = strchr(hreq->path, '#');
+    if (cp)
+        *cp = '\0';
+
     path = (char *)
         odr_malloc(encode, strlen(hreq->path) + strlen(uri_args) + 4);