We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tapir version: 1.20.0
Scala version: 3.4.0
Describe the bug
Hi! 馃枛馃徎 Preflight requests are not processed by the server: 405 Method Not Allowed is returned instead of 204 No Content
How to reproduce?
//> using scala 3.4.0 //> using dep com.softwaremill.sttp.tapir::tapir-vertx-server:1.10.0 import sttp.tapir._ import sttp.tapir.server.vertx.VertxFutureServerInterpreter import sttp.tapir.server.vertx.VertxFutureServerInterpreter._ import io.vertx.core.Vertx import io.vertx.ext.web._ import scala.concurrent.{Await, Future} import scala.concurrent.duration._ import scala.concurrent.ExecutionContext import sttp.tapir.server.vertx.VertxFutureServerOptions import sttp.tapir.server.interceptor.cors.CORSInterceptor import io.vertx.ext.web.handler.CorsHandler @main def tapirVertx = given ExecutionContext = scala.concurrent.ExecutionContext.Implicits.global val vertx = Vertx.vertx() val server = vertx.createHttpServer() val router = Router.router(vertx) // CORS works with native Vert.x handler // router.route().handler(CorsHandler.create()) val myEndpoint = endpoint.get .in("path") .out(plainBody[String]) .serverLogic(_ => Future(Right("OK"))) val corsInterceptor = CORSInterceptor.default[Future] val opts = VertxFutureServerOptions.customiseInterceptors.corsInterceptor( corsInterceptor ) val attach = VertxFutureServerInterpreter(opts.options).route(myEndpoint) attach(router) Await.result(server.requestHandler(router).listen(9000).asScala, Duration.Inf)
and then
curl -v -X OPTIONS http://localhost:9000/path -H 'Origin: http://my.origin' -H 'Access-Control-Request-Method: GET'
Additional information
My guess is that all routing is done inside vert.x Router and execution control is not passed to interceptors
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Tapir version: 1.20.0
Scala version: 3.4.0
Describe the bug
Hi! 馃枛馃徎
Preflight requests are not processed by the server: 405 Method Not Allowed is returned instead of 204 No Content
How to reproduce?
and then
Additional information
My guess is that all routing is done inside vert.x Router and execution control is not passed to interceptors
The text was updated successfully, but these errors were encountered: