Skip to content

Commit 54cbb75

Browse files
committed
XMLHttpRequest: fix a bug where 'Access-Control-Allow-Origin: *' was not handled correctly
1 parent 684e362 commit 54cbb75

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/main/java/org/htmlunit/javascript/host/xml/XMLHttpRequest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,6 +1133,10 @@ private boolean isPreflightAuthorized(final WebResponse preflightResponse) {
11331133
if (HttpHeader.ACCESS_CONTROL_ALLOW_HEADERS.equalsIgnoreCase(pair.getName())) {
11341134
String value = pair.getValue();
11351135
if (value != null) {
1136+
if (value.equals("*")) {
1137+
// all headers are allowed
1138+
return true;
1139+
}
11361140
value = org.htmlunit.util.StringUtils.toRootLowerCase(value);
11371141
final String[] values = org.htmlunit.util.StringUtils.splitAtComma(value);
11381142
for (String part : values) {

0 commit comments

Comments
 (0)