79072716

Date: 2024-10-10 04:24:11
Score: 1
Natty:
Report link

I ran into similar problem with uploadTask(with: request, fromFile: file), the root cause is that the uploadTask(fromFile:) extension will automatically append the header with 'application/octet-stream' as Content-Type if that is not set in the header. While the GCS bucket is expecting an empty Content-Type, thus it keeps failing the upload with a "SignatureDoesNotMatch" error.

I will suggest double check your server's expectation on the Content-Type, and might try setting use headers like let headers = ["Content-Type": "", ...]

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Shijing Xian