Skip to content
New issue

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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strict slashes settings is no longer works in connexion 3.x #1978

Open
hashannalaka opened this issue Sep 24, 2024 · 1 comment
Open

Strict slashes settings is no longer works in connexion 3.x #1978

hashannalaka opened this issue Sep 24, 2024 · 1 comment
Labels
enhancement PR welcome We would welcome and review a PR addressing this issue

Comments

@hashannalaka
Copy link

Description

Connexion 2 accepts both the URLS with or without trailing slashes when the connexion_app.app.url_map.strict_slashes = False. But this behaviour is no longer works in Connexion 3

Expected behaviour

It should accept both the URLS with or without trailing slashes when user call the API.

Actual behaviour

With the connexion upgrade to 3.0 it works bit differently. The request with backslash is responded with a 307 redirect response with the URL without trailing backslash in the response location header.

Example

  • Without backslash

Screenshot from 2024-09-24 09-04-15

  • With backslash

Screenshot from 2024-09-24 09-05-03

Response headers

Response Headers
date: Tue, 24 Sep 2024 03:40:33 GMT
server: uvicorn
content-length: 0
location: http://0.0.0.0:5001/test_endpoint
Response Body

Steps to reproduce

I have created a example application to reproduce the issue.

URL → https://github.com/hashannalaka/connexion-test.git

Additional info:

Output of the commands:

  • python --version : Python 3.11.2
  • pip show connexion | grep "^Version\:" : Version: 3.0.0

Is this the expected behavior in Connexion 3? I would appreciate any help regarding this.

@RobbeSneyders
Copy link
Member

Thanks @hashannalaka,

While I believe the current behavior is the correct default behavior, I would welcome a PR that re-adds a configuration option to disable the differentiation between paths with and without trailing slashes.

@RobbeSneyders RobbeSneyders added enhancement PR welcome We would welcome and review a PR addressing this issue labels Nov 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement PR welcome We would welcome and review a PR addressing this issue
Projects
None yet
Development

No branches or pull requests

2 participants