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

Default to application/octet-stream #1054

Merged
merged 1 commit into from
Nov 23, 2017
Merged

Default to application/octet-stream #1054

merged 1 commit into from
Nov 23, 2017

Conversation

ob-stripe
Copy link
Contributor

@ob-stripe ob-stripe commented Nov 14, 2017

r? @fred-stripe
cc @stripe/api-libraries

Fixes #1053.

We could even remove MimeTypes.cs entirely and just use application/octet-stream always. This is what the Python library does (here).

I've also set a default value for the filename, as the API does require one (cf. stripe/stripe-python#227 for more context).

@remi-stripe
Copy link
Contributor

@fred-stripe friendly bump on this one

Copy link
Contributor

@remi-stripe remi-stripe left a comment

Choose a reason for hiding this comment

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

LGTM barring the comment I put (but really it's minor)

@@ -179,6 +179,11 @@ private static void ApplyMultiPartFileToRequest(HttpRequestMessage requestMessag
{
requestMessage.Headers.ExpectContinue = true;

if (string.IsNullOrEmpty(fileName))
{
fileName = "blob";
Copy link
Contributor

Choose a reason for hiding this comment

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

should we be more explicit to indicate it's a hardcoded value? blob has some meaning for me as a type (like in a database) and so it felt weird the first 2 times I read the PR.

No big deal obviously but wanted to flag

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"blob" is used with more or less the same meaning as in a database: it indicates that what follows is a binary large object. It's also the convention we already use in the Node and Python libraries.

Copy link
Contributor

Choose a reason for hiding this comment

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

gotcha, works for me if we do this in the other libs!

@remi-stripe
Copy link
Contributor

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants