diff --git a/src/lib/curl/Adapter.cxx b/src/lib/curl/Adapter.cxx index 89595566e..3beade3d0 100644 --- a/src/lib/curl/Adapter.cxx +++ b/src/lib/curl/Adapter.cxx @@ -112,8 +112,10 @@ IsResponseBoundaryHeader(StringView s) noexcept } inline void -CurlResponseHandlerAdapter::HeaderFunction(StringView s) noexcept +CurlResponseHandlerAdapter::HeaderFunction(std::string_view _s) noexcept { + const StringView s{_s}; + if (state > State::HEADERS) return; diff --git a/src/lib/curl/Adapter.hxx b/src/lib/curl/Adapter.hxx index fc4c946c3..40c174425 100644 --- a/src/lib/curl/Adapter.hxx +++ b/src/lib/curl/Adapter.hxx @@ -34,8 +34,8 @@ #include #include +#include -struct StringView; class CurlEasy; class CurlResponseHandler; @@ -68,7 +68,7 @@ private: void FinishHeaders(); void FinishBody(); - void HeaderFunction(StringView s) noexcept; + void HeaderFunction(std::string_view s) noexcept; /** called by curl when a new header is available */ static std::size_t _HeaderFunction(char *ptr, diff --git a/src/lib/curl/Request.hxx b/src/lib/curl/Request.hxx index fcd68ca8e..26386afc4 100644 --- a/src/lib/curl/Request.hxx +++ b/src/lib/curl/Request.hxx @@ -35,7 +35,6 @@ #include -struct StringView; class CurlGlobal; class CurlResponseHandler;