Skip to content

Normalize URLs before executing request #180

Open
@guerda

Description

@guerda

I'm using a Swagger API which is out of my control and has the basePath incorrectly set with a trailing /.
This causes pyswagger to request a URL which has a double slash in the URL part. Spring Boot (hosting the service) prevents this and declines the request immediately, which leads to an error message if I want to execute a call:

b'{"timestamp":1565196246823,"status":500,"error":"Internal Server Error","exception":"org.springframework.security.web.firewall.RequestRejectedException","message":"The request was rejected because the URL was not normalized.","path":"/search//v1/search"}'

Would it be possible to normalize the URL before executing the request?
as far as I understood, the initial load of the OpenAPI spec is normalized (core.py, line 283). https://github.com/pyopenapi/pyswagger/blob/develop/pyswagger/core.py#L283

I could imagine that this would fix some errors in URLs.

Thanks in advance for your help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions