[cpp-xmltooling] branch main updated: CPPXT-156 - ETag not being stored off when HTTP/2 used for metadata

Scott Cantor cantor.2 at osu.edu
Tue Jun 6 21:02:09 UTC 2023


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch main
in repository cpp-xmltooling.

View the commit online:
http://git.shibboleth.net/view/?p=cpp-xmltooling.git;a=commit;h=9a8add558656c4cd31a8fbdf5f1134ff2db6d094

The following commit(s) were added to refs/heads/main by this push:
     new 9a8add5  CPPXT-156 - ETag not being stored off when HTTP/2 used for metadata
9a8add5 is described below

commit 9a8add558656c4cd31a8fbdf5f1134ff2db6d094
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Tue Jun 6 17:01:43 2023 -0400

    CPPXT-156 - ETag not being stored off when HTTP/2 used for metadata
    
    https://shibboleth.atlassian.net/browse/CPPXT-156
---
 xmltooling/util/CurlURLInputStream.cpp | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/xmltooling/util/CurlURLInputStream.cpp b/xmltooling/util/CurlURLInputStream.cpp
index bb985bb..c55f66c 100644
--- a/xmltooling/util/CurlURLInputStream.cpp
+++ b/xmltooling/util/CurlURLInputStream.cpp
@@ -79,7 +79,11 @@ namespace {
             return nmemb;
         string* cacheTag = reinterpret_cast<string*>(stream);
         const char* hdr = reinterpret_cast<char*>(ptr);
-        if (strncmp(hdr, "ETag:", 5) == 0) {
+#ifdef HAVE_STRCASECMP
+        if (!strncasecmp(hdr, "Etag:", 5)) {
+#else
+        if (!strnicmp(hdr, "Etag:", 5)) {
+#endif
             hdr += 5;
             size_t remaining = nmemb - 5;
             // skip leading spaces
@@ -105,7 +109,11 @@ namespace {
             if (!cacheTag->empty())
                 *cacheTag = "If-None-Match: " + *cacheTag;
         }
-        else if (cacheTag->empty() && strncmp(hdr, "Last-Modified:", 14) == 0) {
+#ifdef HAVE_STRCASECMP
+        else if (cacheTag->empty() && !strncasecmp(hdr, "Last-Modified:", 14)) {
+#else
+        else if (cacheTag->empty() && !strnicmp(hdr, "Last-Modified:", 14)) {
+#endif
             hdr += 14;
             size_t remaining = nmemb - 14;
             // skip leading spaces

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list