Skip to content

Failed to build MultipartReader #8068

@SaitoLi

Description

@SaitoLi

I found that when using CloudFront CDN and OkHttp for Multipart requests, CloudFront CDN added the 'CloudFront:' field in the boundary, which caused the value of boundary to be null when building MultipartReader. It seems that the cause of the issue is due to the toMediaType method in MediaType not including ':' in its regular expression, causing it to fail. Could you kindly advise on how to solve this problem? okhttp 4.9.x

the response be like:

--CloudFront:ED461CAD63CDFC53A7F46FB099C72CEE
Content-Type: application/octet-stream
Content-Range: bytes xxxxx

and MediaType not including ':'

private const val TOKEN = "([a-zA-Z0-9-!#$%&'*+.^_`{|}~]+)"

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug in existing code

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions