Skip to content

Commit

Permalink
fix: Properly handle unspecified XHR 'sync' parm (#278)
Browse files Browse the repository at this point in the history
  • Loading branch information
rentallect authored Apr 1, 2024
1 parent 8e257e5 commit 249ca86
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/http/ziti-xhr.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 249ca86

Please sign in to comment.