1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-13 13:31:48 +00:00

Disable insecure HTTP methods CONNECT and TRACE in HTML5 platform

(cherry picked from commit 2cd7bc04ea)
This commit is contained in:
Leon Krause
2018-02-17 16:56:40 +01:00
committed by Hein-Pieter van Braam
parent d5535d9357
commit 5bb269d01d

View File

@@ -81,6 +81,8 @@ Ref<StreamPeer> HTTPClient::get_connection() const {
Error HTTPClient::prepare_request(Method p_method, const String &p_url, const Vector<String> &p_headers) {
ERR_FAIL_INDEX_V(p_method, METHOD_MAX, ERR_INVALID_PARAMETER);
ERR_EXPLAIN("HTTP methods TRACE and CONNECT are not supported for the HTML5 platform");
ERR_FAIL_COND_V(p_method == METHOD_TRACE || p_method == METHOD_CONNECT, ERR_UNAVAILABLE);
ERR_FAIL_COND_V(status != STATUS_CONNECTED, ERR_INVALID_PARAMETER);
ERR_FAIL_COND_V(host.empty(), ERR_UNCONFIGURED);
ERR_FAIL_COND_V(port < 0, ERR_UNCONFIGURED);