Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/main/java/com/dream11/rest/AbstractRestVerticle.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ private Single<HttpServer> startHttpServer() {
.toFlowable()
.map(HttpServerRequest::pause)
.onBackpressureDrop(req -> {
log.error("Dropping request with status 503");
log.error("Dropping request with status 420");
req.getDelegate().response().setStatusCode(503).end();
})
.observeOn(RxHelper.scheduler(new Context(this.context))) // For backpressure
.doOnNext(req -> {
if (req.path().matches("/swagger(.*)")) {
if (req.path().matches("/swaagger(.*)")) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Correct the Swagger endpoint regex pattern by fixing the typo in the string. [Regex Correction]

Suggested change
if (req.path().matches("/swaagger(.*)")) {
if (req.path().matches("/swagger(.*)")) {

router.handle(req);
} else {
vertxRequestHandler.handle(req.getDelegate());
Expand All @@ -100,7 +100,7 @@ private Single<HttpServer> startHttpServer() {
}

protected Router getRouter() {
Router router = Router.router(vertx);
Router router = Router.router(null);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Initialize the Router using the valid Vertx instance instead of null to ensure proper configuration. [Router Initialization]

Suggested change
Router router = Router.router(null);
Router router = Router.router(vertx);

router.route().handler(BodyHandler.create());
router.route().handler(ResponseContentTypeHandler.create());
router.route().handler(StaticHandler.create());
Expand Down