GWT 2.8.2 uses HTMLUnit 2.19 which should work with CORS. At least the 
changelog only suggest a single Chrome related fix in 2.21.

Latest GWT uses HTMLUnit 2.55 so maybe you could just override the 
dependency version in your project and try HTMLUnit 2.55.

It doesn't look like you can change the CORS behavior of HTMLUnit: 

https://github.com/HtmlUnit/htmlunit/blob/968027bec887ecabcdc86669b058c43c9db5562c/src/main/java/org/htmlunit/javascript/host/xml/XMLHttpRequest.java#L903

If the CORS preflight request fails to some reason you are out of luck. 
Maybe the CORS header is incorrect or there is some unexpected status code 
because of rate limiting?

-- J.

Kerby schrieb am Sonntag, 27. Juli 2025 um 11:18:22 UTC+2:

> Hi, is there a way to modify the underlying HtmlUnit configuration when 
> running GWTTestCase. My purpose is to make HtmlUnit more relaxed and not 
> throw or ignore CORS error.
>
> Currently, the test in my GWT library fails due to supposedly CORS error 
> even when the server resource is returning the CORS header.
>
> "SEVERE: Job run failed with unexpected RuntimeException: Wrapped 
> java.lang.RuntimeException: No permitted "Access-Control-Allow-Origin" 
> header." 
>
> App is running on GWT 2.8.2 (for Legacy Errai support) 
> and is using the "gwt-maven-plugin" of the same GWT version. 
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/google-web-toolkit/c2731566-5850-413a-b75f-d841aa8a9d31n%40googlegroups.com.

Reply via email to