File tree Expand file tree Collapse file tree 4 files changed +376
-23
lines changed
main/java/org/htmlunit/html
test/java/org/htmlunit/html Expand file tree Collapse file tree 4 files changed +376
-23
lines changed Original file line number Diff line number Diff line change 88
99 <body>
1010 <release version="4.11.0" date="March xx, 2025" description="Bugfixes">
11+ <action type="fix" dev="rbri">
12+ HtmlImage onerror event is triggerd for 204 responses.
13+ </action>
1114 <action type="fix" dev="rbri">
1215 Fix various event initialization when working with WebSocket's.
1316 </action>
Original file line number Diff line number Diff line change 4141import org .htmlunit .WebClient ;
4242import org .htmlunit .WebRequest ;
4343import org .htmlunit .WebResponse ;
44+ import org .htmlunit .http .HttpStatus ;
4445import org .htmlunit .javascript .AbstractJavaScriptEngine ;
4546import org .htmlunit .javascript .PostponedAction ;
4647import org .htmlunit .javascript .host .dom .Document ;
@@ -278,7 +279,9 @@ public void doOnLoad() {
278279 downloadImageIfNeeded ();
279280 // if the download was a success
280281 if (imageWebResponse_ .isSuccess ()) {
281- loadSuccessful = true ; // Trigger the onload handler
282+ if (imageWebResponse_ .getStatusCode () != HttpStatus .NO_CONTENT_204 ) {
283+ loadSuccessful = true ; // Trigger the onload handler
284+ }
282285 }
283286 }
284287 catch (final IOException e ) {
You can’t perform that action at this time.
0 commit comments