Skip to content

[Blob Storage] Invalid HTTP Header When Uploading PDF #33227

Open
@aiell0

Description

@aiell0
  • Package Name: azure-blob
  • Package Version: 12.24.0
  • Operating system: MacOS
  • nodejs
    • version: v22.2.0
  • browser
    • name/version: Arc
  • [] typescript
    • version:
  • Is the bug related to documentation in

Describe the bug
Getting the following error: Failed to save file <file>. Error: Error: Failed to upload file to Azure: One of the HTTP headers specified in the request is not supported

To Reproduce
Steps to reproduce the behavior:

  1. Use NestJS
  2. Run the following code:
      const blockBlobClient: BlockBlobClient = this.azureClient.getBlockBlobClient(store.key);
      await blockBlobClient.uploadStream(readStream, undefined, undefined, {
        blobHTTPHeaders: {
          blobContentType: 'application/pdf',
          blobContentLanguage: 'en-US',
          blobContentEncoding: 'utf-8',
        },
        onProgress: (progress) => {
          this.logger.debug(progress);
        }
      }).catch((error) => {
        this.logger.error(`Error uploading to Azure Blob Storage: ${error.message}`);
        throw new Error(`Failed to upload file to Azure: ${error.message}`);
      });
      this.logger.debug(`"${store.key}" uploaded to Azure Blob storage.`);
    } else {
      throw new Error("No client found");
    }

Expected behavior
Expected the file to upload.

ScreenshotsN/A

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

Labels

ClientThis issue points to a problem in the data-plane of the library.Service AttentionWorkflow: This issue is responsible by Azure service team.StorageStorage Service (Queues, Blobs, Files)customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions