-
Notifications
You must be signed in to change notification settings - Fork 389
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
Pass the serialization format as a mimetype #1176
Conversation
cc @llllllllll |
@@ -130,8 +143,9 @@ def compute_down(expr, ec, **kwargs): | |||
serial = ec.serial | |||
r = post( | |||
ec, | |||
'compute.{serial}'.format(serial=serial.name), | |||
'/compute', |
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 will generate 2 slashes. we might want to update the _request
function to not add the slash.
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.
fixed
try: | ||
serial = _get_format(serial_format) | ||
serial = _get_format(*mimetype_regex.match(content_type).groups()) |
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.
The * makes me think that this could possibly be more than one value; could we just take [0] instead?
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.
yep
Just one comment, but looks good |
try: | ||
serial = _get_format(serial_format) | ||
serial = _get_format(mimetype_regex.match(content_type).groups()[0]) |
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.
actually, this needs to check that match is not none before taking groups()[0] or we get 500 instead of 415
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.
good catch
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.
if None
should that also be a 415?
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.
Yeah, None means we don't know what the media type is; however, a keyerror means we know what it is but this particular server doesn't use that format
Pass the serialization format as a mimetype
the serialization format json, msgpack, etc is now passed as a vendor specific mime type instead of being part of the URL: