Skip to content

context.call assumes a content-type erroneously. #103

Description

@undrscrdt

When fetching a JSONL file from google storage using context.call (context.call(url, {method: "GET"})), it returns a 403 error because the signature does not match the request. The reason for this is that the header "Content-Type" is not expected. Setting the header to "undefined" or "null" does not work because the header isn't removed, it simply is assigned those values.

https://github.com/upstash/workflow-js/blob/main/src/qstash/headers.ts#L209

const contentType =
      (callHeaders.get("content-type")
        ? callHeaders.get("content-type")
        : this.userHeaders?.get("Content-Type")
          ? this.userHeaders.get("Content-Type")
          : undefined) ?? DEFAULT_CONTENT_TYPE;
    this.headers.rawHeaders["content-type"] = contentType;

Headers should not be set when undefined.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions