Closed Bug 1620809 Opened 6 years ago Closed 6 years ago

Please set mime-type to text/plain *.TXT files under https://archive.mozilla.org/pub/seamonkey/

Categories

(Cloud Services :: Operations: Product Delivery, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: ewong, Assigned: oremj)

References

Details

Currently, https://archive.mozilla.org/pub/seamonkey/releases/2.53.1/README.txt (or
any other txt files are served as binary/octet-stream. Please change the TXT files served as text/plain.

Thanks

Blocks: 1619243
Assignee: nobody → oremj

I've fixed existing objects with the following script:

import boto3

s3 = boto3.resource('s3')

bucket = s3.Bucket('net-mozaws-prod-delivery-archive')
objs = bucket.objects.filter(Prefix='pub/seamonkey/')

for o in objs:
    if not o.key.endswith('README'):
        continue
    o.Object().copy_from(
        CopySource={
            'Bucket': 'net-mozaws-prod-delivery-archive',
            'Key': o.key
        },
        ContentType='text/plain',
        MetadataDirective="REPLACE",
    )
    print(f"Changing content type for {o.key}")

If you want new objects to have the content type set correctly, it needs to be specified at upload time. It looks like new files are like the one in the description are already good.

Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED

(In reply to Jeremy Orem [:oremj] from comment #1)

If you want new objects to have the content type set correctly, it needs to be specified at upload time. It looks like new files are like the one in the description are already good.

Thanks Jeremy! I kinda new it had to be a screwup on my part. My apologies for the trouble. I'll fix the upload scripts now.

You need to log in before you can comment on or make changes to this bug.