remove leading/trailing whitespace from hrefs
authorArt Cancro <ajc@citadel.org>
Thu, 25 Jan 2024 00:26:14 +0000 (19:26 -0500)
committerArt Cancro <ajc@citadel.org>
Thu, 25 Jan 2024 00:26:14 +0000 (19:26 -0500)
This was found in the CALDAV 'calendar-multiget' REPORT and has been fixed

webcit-ng/server/caldav_reports.c

index edd0b4558cffc0742568fe82bf73885cca4b9c80..1031a46859d80cfba4fc8331aef8ab1949d91638 100644 (file)
@@ -256,6 +256,7 @@ void caldav_report(struct http_transaction *h, struct ctdlsession *c) {
                StrBuf *ThisHref = NewStrBuf();
                const char *pvset = NULL;
                while (StrBufExtract_NextToken(ThisHref, crp.Hrefs, &pvset, '|') >= 0) {
+                       StrBufTrim(ThisHref);                           // remove leading/trailing whitespace from the href
                        caldav_response(h, c, ReportOut, ThisHref);
                }
                FreeStrBuf(&ThisHref);
@@ -263,7 +264,7 @@ void caldav_report(struct http_transaction *h, struct ctdlsession *c) {
                crp.Hrefs = NULL;
        }
 
-       StrBufAppendPrintf(ReportOut, "</D:multistatus>\n");    // End the REPORT.
+       StrBufAppendPrintf(ReportOut, "</D:multistatus>\n");            // End the REPORT.
 
        add_response_header(h, strdup("Content-type"), strdup("text/xml"));
        h->response_code = 207;