Thanks to visit codestin.com
Credit goes to github.com

Skip to content

HttpRequest.__init__ useless mimeparse #284

Closed
@xmedeko

Description

@xmedeko

Hi,
the code in the HttpRequest.__init__ is useless:

    # Pull the multipart boundary out of the content-type header.
    major, minor, params = mimeparse.parse_mime_type(
        self.headers.get('content-type', 'application/json'))

And it prevents from storage.insert creating explicit dirs without content-type. I.e. this code pass only with the above code removed:

    api = googleapiclient.discovery.build('storage', 'v1', credentials=credentials)
    media = googleapiclient.http.MediaIoBaseUpload(io.BytesIO(b''), '')
    resp = api.objects().insert(bucket=bucket, name='testdir/', media_body=media).execute()

BTW similar code with empty contentType works on the .NET client, too.

Metadata

Metadata

Labels

🚨This issue needs some love.triage meI really want to be triaged.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions