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

padded attribute on jsonify not functioning as expected #495

Closed
codehugger opened this issue Apr 20, 2012 · 3 comments
Closed

padded attribute on jsonify not functioning as expected #495

codehugger opened this issue Apr 20, 2012 · 3 comments
Milestone

Comments

@codehugger
Copy link

When calling jsonify with the padded argument as True the expected behavior is padded JSON response that uses the callback argument. Example

handleResponse({"foo": "bar"})

However when setting padded to False the result is still a padded JSON response with the name of the callback function set to jsonp. Example

jsonp({"foo": "bar"})

Should be

{"foo": "bar"}
@madeline-pratt
Copy link

I added a quick fix for this issue at https://github.com/BeStillAsBright/flask/tree/issue495 but I must admit I'm new to contributing on github so I don't exactly know the proper procedures for this kind of thing.

@rduplain
Copy link
Contributor

@BeStillAsBright the preferred method for contributing is using GitHub pull requests:

http://help.github.com/send-pull-requests/

The fix in b5fc0c3266a45f8b25260360518b2eac2d4eef34 does not handle the case where padded is a string argument. Reviewing this further, I'd like to confirm on the Flask team that the padded API for the jsonify function is what we want. In the current implementation, padded can be a boolean or a string, and that string points to the URL query argument which supplies the function name.

This is a feature added in 0.9-dev, and is not yet fully released. I added a test to make sure we fix this issue before release. If we change the jsonify padded behavior, I'll send an announcement to the mailing list.

jfinkels added a commit to jfinkels/flask that referenced this issue Apr 26, 2012
@rduplain
Copy link
Contributor

rduplain commented May 8, 2012

JSONP removed from Flask core in favor of an extension. See #502.

@rduplain rduplain closed this as completed May 8, 2012
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants