HaxeFoundation / HaxeFoundation/haxe

Http.requestURL throws exception on JS in 4.x

Open
#10,706 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

Test case:
```
class Test {
static function main() {
var url="https://worldtimeapi.org/api/timezone/America/Los_Angeles";

var result = haxe.Http.requestUrl( url );

trace(result);
}
}
```

try.haxe: https://try.haxe.org/#095cB22F

This code runs as expected in 3.4.7, but 4.x will result in `InvalidAccessError: Failed to set the 'responseType' property on 'XMLHttpRequest': The response type cannot be changed for synchronous requests made from a document.` (In JS).

Tested on Chrome and firefox.

As a general note: the async path works fine, so this isn't particularly high priority outside of niche cases where sync requests are preferable

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.