summaryrefslogtreecommitdiffstats
path: root/core/io/http_client.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Unify URI encoding/decoding and add to C#Aaron Franke2021-01-281-3/+3
| | | | http_escape and percent_encode have been unified into uri_encode, and http_unescape and percent_decode have been unified into uri_decode.
* Update copyright statements to 2021Rémi Verschelde2021-01-011-2/+2
| | | | | | | | | | | | | | Happy new year to the wonderful Godot community! 2020 has been a tough year for most of us personally, but a good year for Godot development nonetheless with a huge amount of work done towards Godot 4.0 and great improvements backported to the long-lived 3.2 branch. We've had close to 400 contributors to engine code this year, authoring near 7,000 commit! (And that's only for the `master` branch and for the engine code, there's a lot more when counting docs, demos and other first-party repos.) Here's to a great year 2021 for all Godot users 🎆
* Allows HTTPClient to talk to proxy serverHaoyu Qiu2020-11-141-14/+45
| | | | | * Makes request uri accept absolute URL and authority * Adds Host header only when missing
* Fixes HTTPClient::poll crash after connection is self-assignedHaoyu Qiu2020-10-101-0/+4
|
* Fix spelling & grammar in comments, docs, and messagesAndy Maloney2020-07-211-1/+1
|
* Style: Enforce braces around if blocks and loopsRémi Verschelde2020-05-141-12/+20
| | | | | Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
* Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde2020-05-141-49/+0
| | | | | | | | | | | | | | Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
* Enforce use of bool literals instead of integersRémi Verschelde2020-05-141-1/+1
| | | | | Using clang-tidy's `modernize-use-bool-literals`. https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-bool-literals.html
* Port member initialization from constructor to declaration (C++11)Rémi Verschelde2020-05-141-18/+1
| | | | | | | | | | Using `clang-tidy`'s `modernize-use-default-member-init` check and manual review of the changes, and some extra manual changes that `clang-tidy` failed to do. Also went manually through all of `core` to find occurrences that `clang-tidy` couldn't handle, especially all initializations done in a constructor without using initializer lists.
* Style: Set clang-format Standard to Cpp11Rémi Verschelde2020-03-171-1/+1
| | | | | | | | | | For us, it practically only changes the fact that `A<A<int>>` is now used instead of the C++03 compatible `A<A<int> >`. Note: clang-format 10+ changed the `Standard` arguments to fully specified `c++11`, `c++14`, etc. versions, but we can't use `c++17` now if we want to preserve compatibility with clang-format 8 and 9. `Cpp11` is still supported as deprecated alias for `Latest`.
* PoolVector is gone, replaced by VectorJuan Linietsky2020-02-181-13/+13
| | | | | Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are sugar for `Vector<Type>`.
* Update copyright statements to 2020Rémi Verschelde2020-01-011-2/+2
| | | | | | | | | | | Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
* Merge pull request #33640 from mewin/http_head_requestFabio Alessandrelli2019-12-011-0/+10
|\ | | | | Fix HTTP HEAD requests
| * do not wait for response body when making a HEAD requestPatrick Wuttke2019-11-261-0/+10
| |
* | Merge pull request #33862 from Faless/net/http_request_chunk_sizeRémi Verschelde2019-11-251-0/+6
|\ \ | | | | | | Add download_chunk_size property to HTTPRequest.
| * | Add download_chunk_size property to HTTPRequest.Fabio Alessandrelli2019-11-241-0/+6
| |/ | | | | | | | | | | This allows setting the `read_chunk_size` of the internal HTTPClient. This is important to reduce the allocation overhead and number of file writes when downloading large files, allowing for better download speed.
* / Fix HTTPClient::poll crash when connection set to nullArtem Burjachenko2019-11-231-0/+2
|/
* Remove unnecessary code and add some error explanationsqarmin2019-07-011-2/+0
|
* Some code changed with Clang-Tidyqarmin2019-06-261-1/+1
|
* Fix a random SSL crash I saw once.Hein-Pieter van Braam-Stewart2019-06-061-0/+6
| | | | | I don't know why this happened, I was debugging another issue. This should take care of it though.
* Fix typos with codespellRémi Verschelde2019-05-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using codespell 1.15.0. Method: ``` $ cat > ../godot-word-whitelist.txt << EOF ang curvelinear doubleclick leapyear lod merchantibility nd numer ois ony que seeked synching te uint unselect webp EOF $ codespell -w -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po" $ git diff // undo unwanted changes ```
* Fix HTTPClient keep alive with chunked encoding.Fabio Alessandrelli2019-02-201-2/+28
| | | | | | | | | | | | | | | We need to consume the trailer part and final CRLF after last chunk as per RFC 7230 section 4.1: ``` chunked-body = *chunk last-chunk trailer-part CRLF ``` We do not return the trailer part, just consume it allowing following requests to work as expected when using keep alive.
* HTTPClient read until EOF fixesFabio Alessandrelli2019-02-201-39/+16
|
* Fix keep-alive without header in HTTP clientFabio Alessandrelli2019-02-161-7/+6
|
* Update copyright statements to 2019Rémi Verschelde2019-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Fix warnings about unhandled enum value in switch [-Wswitch]Rémi Verschelde2018-09-271-1/+3
| | | | | | | | | | | Fixes GCC 5 warnings of the form: core/io/http_client.cpp:288:9: warning: enumeration value 'STATUS_SSL_HANDSHAKE_ERROR' not handled in switch [-Wswitch] core/io/marshalls.cpp:806:9: warning: enumeration value 'AABB' not handled in switch [-Wswitch] Those can be trivial cases where adding a default fallback is the solution, or more complex issues/hidden bugs where missed values are actually meant to be handled.
* Add checks for clean disconnect in HTTP/TCP/SSL.Fabio Alessandrelli2018-09-211-0/+12
| | | | | Half-open TCP connection can, of course, only be detected by writing the socket, or waiting for TCP timeout.
* Fix HTTPClient _get_http_data bug after #21976.Fabio Alessandrelli2018-09-151-2/+2
|
* Merge pull request #21976 from Faless/http_client_eof_fixRémi Verschelde2018-09-131-9/+22
|\ | | | | Fix non chunked HTTP reading till eof.
| * Fix non chunked HTTP reading till eof.Fabio Alessandrelli2018-09-121-9/+22
| |
* | Merge pull request #21982 from luzpaz/misc-typosRémi Verschelde2018-09-131-1/+1
|\ \ | | | | | | Misc. typos
| * | Misc. typosluz.paz2018-09-121-1/+1
| | | | | | | | | Found via `codespell -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po"`
* | | Unify StreamPeerTCP/TCP_Server with NetSocket APIFabio Alessandrelli2018-09-121-1/+1
| |/ |/|
* | Make core/ includes absolute, remove subfolders from include pathRémi Verschelde2018-09-121-2/+3
|/ | | | | | This allows more consistency in the manner we include core headers, where previously there would be a mix of absolute, relative and include path-dependent includes.
* Reduce unnecessary COW on Vector by make writing explicitHein-Pieter van Braam2018-07-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | This commit makes operator[] on Vector const and adds a write proxy to it. From now on writes to Vectors need to happen through the .write proxy. So for instance: Vector<int> vec; vec.push_back(10); std::cout << vec[0] << std::endl; vec.write[0] = 20; Failing to use the .write proxy will cause a compilation error. In addition COWable datatypes can now embed a CowData pointer to their data. This means that String, CharString, and VMap no longer use or derive from Vector. _ALWAYS_INLINE_ and _FORCE_INLINE_ are now equivalent for debug and non-debug builds. This is a lot faster for Vector in the editor and while running tests. The reason why this difference used to exist is because force-inlined methods used to give a bad debugging experience. After extensive testing with modern compilers this is no longer the case.
* HTTP client now uses non blocking handshakeFabio Alessandrelli2018-07-161-5/+31
|
* Fix CORS problems due to added headers on JS targetGagaPete2018-07-041-2/+31
| | | | | | | | | | | Before this change, missing User-Agent and Accept headers were automatically added on all platforms. Setting the User-Agent header forces the browser to do a CORS preflight (see 1) which fails if the HTTP endpoint is not configured appropriate. It's not neccesary to set either header as the browser sets them and so this commit disables that functionality on the JS target. 1: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Simple_requests
* Allow body-up-to-EOF HTTP responsesPedro J. Estébanez2018-05-221-15/+49
| | | | | | Implements the same heuristic as Curl (and web browsers): if no `Content-Length`, no `Connection: keep-alive` and no chunked transfer encoding, assume th rest of the data until EOF is the body, gracefully setting the HTTP client back to the disconnected state. Theoretically, this is not compliant with HTTP 1.1, by which `keep-alive` is the default, but in practice, an explicit header is sent by servers.
* Revert "Unify http- and percent- encode/decode"Pedro J. Estébanez2018-04-121-3/+3
| | | | This reverts commit b76ee30917c63211ac9e94a21bebbddf518d169f.
* Enhance HTTPClient.query_string_from_dict()Pedro J. Estébanez2018-03-271-1/+21
|
* Unify http- and percent- encode/decodePedro J. Estébanez2018-03-271-1/+1
| | | | | There was a percent-prefixed version, which was exposed, and a http-prefixed version which was not (only to GDNative). This commit keeps the percent-prefixed versions, but with the http-prefixed implementations.
* Fix wrong SSL handshakePedro J. Estébanez2018-03-041-1/+1
| | | | The name of the remote host is passed to mbed TLS in all cases so the client hello message is correctly formed.
* Bind many more properties to scriptsBojidar Marinov2018-01-121-0/+3
| | | | | | | Notable potentially breaking changes: - PROPERTY_USAGE_NOEDITOR is now PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_NETWORK, without PROPERTY_USAGE_INTERNAL - Some properties were renamed, and sometimes even shadowed by new ones - New getter methods (some virtual) were added
* Add missing copyright headers and fix formattingRémi Verschelde2018-01-051-0/+1
| | | | | | Using `misc/scripts/fix_headers.py` on all Godot files. Some missing header guards were added, and the header inclusion order was fixed in the Bullet module.
* Update copyright statements to 2018Rémi Verschelde2018-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Fix javascript build error and improve #14604Fabio Alessandrelli2017-12-151-2/+2
|
* HTTP cleanup & better defaultsmhilbrunner2017-12-141-62/+66
|
* HTTPClient: Add PATCH method and missing HTTP status codesmhilbrunner2017-12-121-2/+17
|
* Implement HTTPClient in HTML5 platformLeon Krause2017-11-131-66/+69
| | | | | | | | | | | Limitations: - Subject to same-origin policy - No persistent connection (but simulated for compatibility) - No blocking mode - No StreamPeer access - No chunked responses - Cannot disable host verification
* Remove HTTPClient::send_body_text and ::send_body_dataLeon Krause2017-10-261-12/+0
| | | | | These were never implemented, the request* methods provide parameters to send body data as part of the client's requests.