-
Notifications
You must be signed in to change notification settings - Fork 11
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
Flask Debug Toolbar #120
base: master
Are you sure you want to change the base?
Flask Debug Toolbar #120
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -75,7 +75,7 @@ def getQhawaxStatus(): | |||||||||
name = request.args.get("name") | ||||||||||
try: | ||||||||||
return ( | ||||||||||
str(same_helper.getQhawaxStatus(name)) | ||||||||||
make_response(jsonify(same_helper.getQhawaxStatus(name))) | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is my second question, @GersonMontesinos. If I keep these endpoints as they are, they return a str, which will then become a HTML without any There are 3 options here:
Suggested change
For both options 2 and 3, I would have to change it for all your non-JSON responses, which could take some time. And, more important, your API customers (even the frontend) might need to modify their code in case they are expecting a str() instead of a JSON str or a "valid" HTML (with the extra tags). What would you like to do? 😄 |
||||||||||
if (same_helper.getQhawaxStatus(name) != None) | ||||||||||
else make_response( | ||||||||||
{"Warning": "qHAWAX name has not been found"}, 400 | ||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is my first question, @GersonMontesinos. This secret key shouldn't be written here even if it's open source, for security reasons. One alternative would be to do this:
But then in your production environment you would need to set this environment variable. How would you like to proceed?