From 249ca860307083615b3b48d321e7561396d44211 Mon Sep 17 00:00:00 2001 From: Curt Tudor Date: Mon, 1 Apr 2024 08:46:19 -0600 Subject: [PATCH] fix: Properly handle unspecified XHR 'sync' parm (#278) --- src/http/ziti-xhr.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/http/ziti-xhr.js b/src/http/ziti-xhr.js index 89ba302..5fca8a8 100644 --- a/src/http/ziti-xhr.js +++ b/src/http/ziti-xhr.js @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { isEqual } from "lodash-es"; +import { isEqual, isUndefined } from "lodash-es"; import { ZitiProgressEventWrapper } from './ziti-event-wrapper'; function ZitiXMLHttpRequest () { @@ -147,8 +147,10 @@ function ZitiXMLHttpRequest () { */ this.open = function(method, url, async, user, password) { - if (!async) { - window.zitiBrowzerRuntime.synchronousXHREncounteredEventHandler({}); + if (!isUndefined(async)) { // default is true + if (!async) { + window.zitiBrowzerRuntime.synchronousXHREncounteredEventHandler({}); + } } errorFlag = false;