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

Fix hex vs float parsing in request body #2597

Merged
merged 3 commits into from Jul 18, 2016

Conversation

Projects
None yet
2 participants
@carlfeberhard
Copy link
Contributor

commented Jul 7, 2016

Two commits here for two underlying issues:

  • The history contents copy AJAX call was not properly rendering its request body as JSON and the call's payload was being parsed as multipart-form
  • When parsing a non-json request body (such as the multipart-form mentioned above), params for a payload have been parsed individually using loads on a single value. This can cause a hex id in the (regex) form '\d+e\d+' (e.g. 40000000000000e5) to be parsed as a float

These commits:

  • correctly render the contents copy params for AJAX
  • add a parse_non_hex_float function that refuses to parse scientific notation in the above form
  • and use it only in the payload parsing method for non-json request bodies

Fixes #2523

carlfeberhard added some commits Jul 7, 2016

Core, request body: handle hex vs. float better
When parsing a non-json request body, params for a payload have
been parsed individually using loads on a single value. This can cause
a hex id in the (regex) form '\d+e\d+' to be parsed as a float.

This commit:
- adds a parse_non_hex_float function that refuses to parse scientific
notation in the above form
- and uses it *only* in the payload parsing method for non-json request
bodies
@carlfeberhard

This comment has been minimized.

Copy link
Contributor Author

commented Jul 12, 2016

@galaxybot test this

Edit: Hmmm. Must be a bad motivator.

@carlfeberhard

This comment has been minimized.

Copy link
Contributor Author

commented Jul 13, 2016

@galaxybot test this

@dannon dannon merged commit 3b19a06 into galaxyproject:dev Jul 18, 2016

4 checks passed

api test Build finished. 220 tests run, 0 skipped, 0 failed.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
framework test Build finished. 110 tests run, 0 skipped, 0 failed.
Details
toolshed test Build finished. 582 tests run, 0 skipped, 0 failed.
Details

@carlfeberhard carlfeberhard deleted the carlfeberhard:fix.hex-vs-float branch Jul 18, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.