summaryrefslogtreecommitdiff
path: root/platform/javascript
diff options
context:
space:
mode:
Diffstat (limited to 'platform/javascript')
-rw-r--r--platform/javascript/http_client_javascript.cpp5
-rw-r--r--platform/javascript/js/engine/config.js43
2 files changed, 27 insertions, 21 deletions
diff --git a/platform/javascript/http_client_javascript.cpp b/platform/javascript/http_client_javascript.cpp
index 45aa68ce7c..c946302862 100644
--- a/platform/javascript/http_client_javascript.cpp
+++ b/platform/javascript/http_client_javascript.cpp
@@ -87,6 +87,11 @@ Error HTTPClientJavaScript::request(Method p_method, const String &p_url, const
ERR_FAIL_COND_V(port < 0, ERR_UNCONFIGURED);
ERR_FAIL_COND_V(!p_url.begins_with("/"), ERR_INVALID_PARAMETER);
+ Error err = verify_headers(p_headers);
+ if (err) {
+ return err;
+ }
+
String url = (use_tls ? "https://" : "http://") + host + ":" + itos(port) + p_url;
Vector<CharString> keeper;
Vector<const char *> c_strings;
diff --git a/platform/javascript/js/engine/config.js b/platform/javascript/js/engine/config.js
index 5628ddbab5..a6f9c4614c 100644
--- a/platform/javascript/js/engine/config.js
+++ b/platform/javascript/js/engine/config.js
@@ -225,34 +225,35 @@ const InternalConfig = function (initConfig) { // eslint-disable-line no-unused-
*/
Config.prototype.update = function (opts) {
const config = opts || {};
- const me = this;
- function parse(key) {
+ // NOTE: We must explicitly pass the default, accessing it via
+ // the key will fail due to closure compiler renames.
+ function parse(key, def) {
if (typeof (config[key]) === 'undefined') {
- return me[key];
+ return def;
}
return config[key];
}
// Module config
- this.unloadAfterInit = parse('unloadAfterInit');
- this.onPrintError = parse('onPrintError');
- this.onPrint = parse('onPrint');
- this.onProgress = parse('onProgress');
+ this.unloadAfterInit = parse('unloadAfterInit', this.unloadAfterInit);
+ this.onPrintError = parse('onPrintError', this.onPrintError);
+ this.onPrint = parse('onPrint', this.onPrint);
+ this.onProgress = parse('onProgress', this.onProgress);
// Godot config
- this.canvas = parse('canvas');
- this.executable = parse('executable');
- this.mainPack = parse('mainPack');
- this.locale = parse('locale');
- this.canvasResizePolicy = parse('canvasResizePolicy');
- this.persistentPaths = parse('persistentPaths');
- this.persistentDrops = parse('persistentDrops');
- this.experimentalVK = parse('experimentalVK');
- this.focusCanvas = parse('focusCanvas');
- this.gdnativeLibs = parse('gdnativeLibs');
- this.fileSizes = parse('fileSizes');
- this.args = parse('args');
- this.onExecute = parse('onExecute');
- this.onExit = parse('onExit');
+ this.canvas = parse('canvas', this.canvas);
+ this.executable = parse('executable', this.executable);
+ this.mainPack = parse('mainPack', this.mainPack);
+ this.locale = parse('locale', this.locale);
+ this.canvasResizePolicy = parse('canvasResizePolicy', this.canvasResizePolicy);
+ this.persistentPaths = parse('persistentPaths', this.persistentPaths);
+ this.persistentDrops = parse('persistentDrops', this.persistentDrops);
+ this.experimentalVK = parse('experimentalVK', this.experimentalVK);
+ this.focusCanvas = parse('focusCanvas', this.focusCanvas);
+ this.gdnativeLibs = parse('gdnativeLibs', this.gdnativeLibs);
+ this.fileSizes = parse('fileSizes', this.fileSizes);
+ this.args = parse('args', this.args);
+ this.onExecute = parse('onExecute', this.onExecute);
+ this.onExit = parse('onExit', this.onExit);
};
/**