Skip to content
This repository has been archived by the owner on Jan 14, 2021. It is now read-only.

Monkey patch flask.jsonify to handle JSONP responses. #167

Merged
merged 2 commits into from Feb 25, 2015
Merged

Conversation

ralphbean
Copy link
Contributor

I specifically want this for the Fedora releng-dash so it can query at
page-load and find out:

  • What collections are active and which are EOL.
  • What collections are "Under development" but not rawhide.. i.e., are
    we currently "branched"?

I specifically want this for the Fedora releng-dash so it can query at
page-load and find out:

- What collections are active and which are EOL.
- What collections are "Under development" but not rawhide.. i.e., are
  we currently "branched"?

callback = flask.request.args.get('callback', None)

if callback:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we check that the request is a GET and never a POST? Since the API is r/w I would prefer that we do not support jsonp on POST queries.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be done in b0fa924

@pypingou
Copy link
Member

I was wondering if it makes sense to have it in pkgdb2/__init__py vs having it in pkgdb2/api/__init__.py but while this is only intended for the API endpoint there is no code that restricts it to the /api/ section/blueprint, so won't change much

👍

ralphbean added a commit that referenced this pull request Feb 25, 2015
Monkey patch flask.jsonify to handle JSONP responses.
@ralphbean ralphbean merged commit fd67ed6 into master Feb 25, 2015
@ralphbean ralphbean deleted the jsonp branch February 25, 2015 22:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants