Skip to content

Content-Type header should not be overridden #4

Closed
@iamjamesim

Description

@iamjamesim

Bug report

Describe the bug

FunctionInvokeOptions overrides the specified Content-Type header value to application/octet-stream when body is of type Data.

To Reproduce

let boundary = "Boundary-\(UUID().uuidString)"
let contentType = "multipart/form-data; boundary=\(boundary)"
let options = FunctionInvokeOptions(
  headers: ["Content-Type": contentType],
  body: "binary value".data(using: .utf8)!
)
print(options.headers)

Output

["Content-Type": "application/octet-stream"]

Expected behavior

Functions are invoked with the specified Content-Type header value.

System Information

  • functions-swift: 1.0.0

Additional context

I'm trying to invoke a function that handles multipart/form-data requests (based on this example function).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions