-
Notifications
You must be signed in to change notification settings - Fork 111
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
Bad Assumption in AcceptableMimeType, Leading to "Invalid MIME type" #86
Comments
Currently, we'll allow any string as the MIME type -- but valid MIME types must contain a `/`. The code implicitly assumes this, so we might as well check it and raise a comprehensible error.
Ah, yes, that's entirely believable. Would you be willing to send along a PR with the fix? |
I'd like to, but I'm just using this function to get Google's Managed VM system to work and this is only one of several other issues I'm facing. I have a workaround for this (e.g., not upload any .p12 files), so I'm not sure I'll be able to get to it. |
So I just took a quick skim through the stdlib -- it looks like Do you have a small failing sample? |
Ping. This just caused gcloud to crash: https://stackoverflow.com/questions/49652346/deploying-app-engine-app-with-p12-file-using-cloud-tools-for-eclipse Any progress here? |
The function
AcceptableMimeType
inbase/py/util.py
incorrectly assumes that all mimetypes will have a forward slash within them:This assumption fails for
.p12
files, which are used for server-to-server authentication. The functionmimetypes.guess_type
returnsx-pkcs12
for.p12
files instead ofapplication/x-pkcs12
. This may be a bug withmimetypes
, but it should nevertheless be handled properly by theapitools
.The text was updated successfully, but these errors were encountered: