Skip to content

Commit 40704b3

Browse files
committed
XMLHttpRequest adds the origin header to patch requests
1 parent 710d938 commit 40704b3

2 files changed

Lines changed: 1 addition & 6 deletions

File tree

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,6 @@ public void open(final String method, final Object urlParam, final Object asyncP
715715
else {
716716
isSameOrigin_ = UrlUtils.isSameOrigin(pageUrl, fullUrl);
717717
final boolean alwaysAddOrigin = HttpMethod.GET != request.getHttpMethod()
718-
&& HttpMethod.PATCH != request.getHttpMethod()
719718
&& HttpMethod.HEAD != request.getHttpMethod();
720719
if (alwaysAddOrigin || !isSameOrigin_) {
721720
final StringBuilder origin = new StringBuilder().append(pageUrl.getProtocol()).append("://")

src/test/java/org/htmlunit/javascript/host/xml/XMLHttpRequestTest.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1472,11 +1472,7 @@ public void originHeaderDelete() throws Exception {
14721472
* @throws Exception if the test fails
14731473
*/
14741474
@Test
1475-
@Alerts({"§§URL§§/", "null", "null"})
1476-
@HtmlUnitNYI(CHROME = {"§§URL§§/foo.xml", "null", "null"},
1477-
EDGE = {"§§URL§§/foo.xml", "null", "null"},
1478-
FF = {"§§URL§§/foo.xml", "null", "null"},
1479-
FF_ESR = {"§§URL§§/foo.xml", "null", "null"})
1475+
@Alerts({"§§URL§§/foo.xml", "§§URL§§", "null"})
14801476
public void originHeaderPatch() throws Exception {
14811477
final String html = DOCTYPE_HTML
14821478
+ "<html><head><script>\n"

0 commit comments

Comments
 (0)