Skip to content

Commit

Permalink
Merge pull request #20787 from stuartwdouglas/20778
Browse files Browse the repository at this point in the history
Don't attempt to end the request if already ended
  • Loading branch information
geoand authored Oct 15, 2021
2 parents e6c3cee + 63d9059 commit 09faf5d
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.quarkus.vertx.http.runtime.security;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.function.BiFunction;
Expand Down Expand Up @@ -170,12 +171,20 @@ public void onSubscribe(UniSubscription subscription) {

@Override
public void onItem(Boolean item) {
routingContext.response().end();
if (!routingContext.response().ended()) {
routingContext.response().end();
}
}

@Override
public void onFailure(Throwable failure) {
routingContext.fail(failure);
if (!routingContext.response().ended()) {
routingContext.fail(failure);
} else if (!(failure instanceof IOException)) {
log.error("Failed to send challenge", failure);
} else {
log.debug("Failed to send challenge", failure);
}
}
});
} else {
Expand Down

0 comments on commit 09faf5d

Please sign in to comment.