-
Notifications
You must be signed in to change notification settings - Fork 2k
Open
Description
Feature Request: Add content_type option to gcp_cloud_storage sink
Problem
The aws_s3 sink supports a content_type configuration option to override the MIME type of uploaded objects:
[sinks.s3]
type = "aws_s3"
content_type = "text/plain; charset=utf-8"However, the gcp_cloud_storage sink does not have this option. This makes it impossible to set the correct Content-Type header (including charset) for objects uploaded to GCS.
Use Case
When uploading UTF-8 text files to GCS, the browser preview shows corrupted characters (mojibake) because GCS defaults to text/plain without charset=utf-8. Users need to manually patch objects after upload or use Cloud Functions as a workaround.
Expected Behavior
Add content_type option to gcp_cloud_storage sink, matching the aws_s3 sink behavior:
[sinks.gcs]
type = "gcp_cloud_storage"
bucket = "my-bucket"
content_type = "text/plain; charset=utf-8"
[sinks.gcs.encoding]
codec = "text"Current Workaround
- Post-upload Cloud Function to patch Content-Type metadata
- Manual
gcloud storage objects update --content-typeafter upload
References
- AWS S3 sink
content_type: https://vector.dev/docs/reference/configuration/sinks/aws_s3/ - GCS sink docs (no content_type): https://vector.dev/docs/reference/configuration/sinks/gcp_cloud_storage/
benjamin-awd
Metadata
Metadata
Assignees
Labels
No labels