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
match flask pattern to return extra headers #34
Conversation
b27d4a8
to
257e660
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Hello @cardoe, Thank you for contributing. Could please add tests to properly cover added functionality? Jirka |
Sure. I didn't see where the existing behavior of returning the tuple was tested because that's where I wanted to add a test for this so I assumed it was untested in general. Can you point me to the right spot? |
Let's not test the point of returning the tuple. I was thinking about testing the overall functionality of modifying response header. I. e. create test route returning 3-tuple and check whether it really has an effect on response headers. |
Technically Flask allows you to return from a route with a tuple of 3 items with the last item being a dictionary of headers. The docs mention it here: https://flask.palletsprojects.com/en/1.1.x/quickstart/#about-responses This adjusts the behavior of the validate decorator to allow this as well. Matches the behavior in: https://github.com/pallets/flask/blob/64213fc0214c1044fa2c9e60d0e2683e75d125c0/src/flask/app.py#L1644-L1646
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
I've implemented the test. Currently the testing fails on a test that's failing in master today. |
@bauerji let me know if this test solves the need or what other steps I need to do. |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Nice, thank you for contribution. I've made some adjustment in master branch, after rebasing all tests passed fine. |
Technically Flask allows you to return from a route with a tuple of 3
items with the last item being a dictionary of headers. The docs mention
it here: https://flask.palletsprojects.com/en/1.1.x/quickstart/#about-responses
This adjusts the behavior of the validate decorator to allow this as
well. Matches the behavior in: https://github.com/pallets/flask/blob/64213fc0214c1044fa2c9e60d0e2683e75d125c0/src/flask/app.py#L1644-L1646