summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorFrank Berghaus <berghaus@cern.ch>2022-09-21 16:50:17 (GMT)
committerGitHub <noreply@github.com>2022-09-21 16:50:17 (GMT)
commit100b22e6c23c44a082fd69b8c05a63c7492083f7 (patch)
tree744a5409278b46f62765dfe23345d0b6a3c66dfb /config
parentd491c33a72c9e6cabe10a7508c1cc76c1d638479 (diff)
downloadhdf5-100b22e6c23c44a082fd69b8c05a63c7492083f7.zip
hdf5-100b22e6c23c44a082fd69b8c05a63c7492083f7.tar.gz
hdf5-100b22e6c23c44a082fd69b8c05a63c7492083f7.tar.bz2
Use case-insensitive comparison for headers fix #2100 (#2101)
* Use case-inseneitive comparison for headers HTTP headers should be case-insensitive. Use case-insensitive string comparisons when working with HTTP header responses to ensure compatibility. * Revert "Use case-inseneitive comparison for headers" This reverts commit a02f591723506b62b7208449be6eef7122120398 * Ignore case when searching HTTP header responses Looking up the Content-Length in the header returned by S3 storage endpoints should ignore case. To guarantee portability implement a function for case-insensitive string search, because it is non-standard. * Add an _ after H5 for the strcasestr implementation It is a private function and should sport that underscore. * Remove author comment from the doc comment * Use search function defined by system if available Check whether the system provides a function implementing case insensitive string searches. Only use the custom implementation if the system does not provide the functionality. * Add tests for case-insensitive search Basic tests: - Search for empty string - Search with exact match - Search with case-insensitive match - search with no match * Enforce clang-format style Some variable definitions in the th5_system tests did not conform to clang-format's expectations. Updated the offending lines. * Correct comment describing test case * Added some spaces to please clang-format * Ignore discarding const Ask the compiler to ignore discarding the const when retunring a match from H5_strcasestr Co-authored-by: Frank Berghaus <frank.berghaus@mpcdf.mpg.de>
Diffstat (limited to 'config')
-rw-r--r--config/cmake/ConfigureChecks.cmake1
-rw-r--r--config/cmake/H5pubconf.h.in3
2 files changed, 4 insertions, 0 deletions
diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake
index d71ca08..ee90128 100644
--- a/config/cmake/ConfigureChecks.cmake
+++ b/config/cmake/ConfigureChecks.cmake
@@ -455,6 +455,7 @@ CHECK_FUNCTION_EXISTS (sigsetjmp ${HDF_PREFIX}_HAVE_SIGSETJMP)
CHECK_FUNCTION_EXISTS (sigprocmask ${HDF_PREFIX}_HAVE_SIGPROCMASK)
CHECK_FUNCTION_EXISTS (srandom ${HDF_PREFIX}_HAVE_SRANDOM)
+CHECK_FUNCTION_EXISTS (strcasestr ${HDF_PREFIX}_HAVE_STRCASESTR)
CHECK_FUNCTION_EXISTS (strdup ${HDF_PREFIX}_HAVE_STRDUP)
CHECK_FUNCTION_EXISTS (symlink ${HDF_PREFIX}_HAVE_SYMLINK)
diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in
index a500f46..1f2e1b5 100644
--- a/config/cmake/H5pubconf.h.in
+++ b/config/cmake/H5pubconf.h.in
@@ -313,6 +313,9 @@
/* Define to 1 if you have the <stdlib.h> header file. */
#cmakedefine H5_HAVE_STDLIB_H @H5_HAVE_STDLIB_H@
+/* Define to 1 if you have the `strcasestr' function. */
+#cmakedefine H5_HAVE_STRCASESTR @H5_HAVE_STRCASESTR@
+
/* Define to 1 if you have the `strdup' function. */
#cmakedefine H5_HAVE_STRDUP @H5_HAVE_STRDUP@