Home > Software design >  Swagger UI does not sent "origin" header
Swagger UI does not sent "origin" header

Time:09-17

I using Swagger UI (http://localhost:8080/swagger-ui/index.html) with OpenAPI 3.0. I have configured it to add Authorization and Origin header parameters to the request. I am using @ApiImplicitParam annotation in my Spring Boot application for that.

The problem is that Swagger UI does not send Origin amongst the other header parameters. I can see

-H "Origin: https://localhost"

in the curl command it builds, but it does not send the origin to the server. The rest of the parameters are fine. At the same time generated "curl" command sends the origin just file.

How can I make the Swagger UI send everything like its curl?

CodePudding user response:

Origin is a forbidden header, meaning it is controlled by the browser itself and cannot be changed from JavaScript.

  • Related