This overhauls the RFC 1123 and ISO 8601 parsing with bits copied from the autorest C prototype, giving more consistent behavior across platforms, and removing unintended locale dependencies. (For example, before on POSIX on a German machine we might emit Die, 19 Mär 2019 09:59:57 which would be rejected by servers)
There is a subtle breaking change in that we previously accepted a time with no date, e.g. "12:12:12Z", and this change rejects that. However, such input is not a valid ISO 8601 input, and we were crazy about how we handled it before. Before, on Windows we would fill in the date with whatever the current date is, but on POSIX we would fill in January 1, 1970. Considering this was never consistent, and considering 99.999% of internet customers are going to be using RFC 3339 which requires all the components, I've dropped that special case.
Lots of tests also added.
* Add the missing ssl::context callback in websocket_client_config, borrowing heavily from http_client
* Add dependency on Boost and OpenSSL when websocketpp is used for Secure WebSocket, just like for http_client when CPPREST_HTTP_CLIENT_IMPL STREQUAL "asio"
This was forced on us by a change made in Azure Pipelines.
This change also builds Android with an updated copy of CMake; the version included with Ubuntu didn't have the Boost_ARCHITECTURE knob we need to change for the new -a32 and -x32 library suffixes.
This matches the asio implementation to what the winhttp implementation was doing.
Also turned on a test that looked related; I'm not positive that this change fixed that test but it passes for me now.
* handle multi-byte unicode characters in json parsing
* Properly check high surrogate start and end
Co-Authored-By: Tymolc <tim.oesterreich1@gmail.com>
* Update vcpkg.
* Resolve double free when WinHttpSendRequest fails
A customer reported that win WinHttpSendRequest fails, WinHTTP still
delivers WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING callbacks. When
_start_request_send encountered a failure, it deleted the context
weak_ptr, and then the WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING
also tried to delete it, resulting in double frees.
This change binds the weak_ptr to the handle more directly and avoids paying attention to WinHttpSendRequest.
* FIX: check whether instream() is valid before trying to rewind
* add .can_seek() as a second line of defense
* apply clang-format
* improve error reporting for unrewindable streams
* Add René Meusel (reneme) to CONTRIBUTORS.txt.
* #993, #1002: Add flexibility for iOS building. Adds command line args to configure.sh to allow more customization of iOS lib
* Add mobileben to CONTRIBUTORS.txt
* add append_path_raw() to uri_builder
* modify implementation details
* modified test case
* fixed append_path_raw and included a testscase for a trailing slash with that API
* update submodule to vcpkg master due to the NuGet hash changes
* Avoid double encoding through set_path and add tests. Extract single slash string comparison. Reduce string copy count. Add VS Code settings and launch.
* Optimize append_path similarly.
* Also optimize append_query.
* Also optimize other uri_builder things.
* Avoid self references.
Due to the initial allocation of the error message, the returned std::string had a size of 4096. Since FormatMessageW already returns the number of characters written to the buffer an additional call to resize using the returned count will neatly trim the string.