Skip to content

Error on gzipped JSON response #83

@mstetson

Description

@mstetson

AWSCore.jl automatically decodes certain response MIME types, but doesn't pay attention to the Content-Encoding header, so it fails when the data is compressed. Example:

using AWSS3

bucket = "SOMETHING-YOU-OWN"
s = """
    {"foo":"bar"}
    """
gz = open(`gzip`, "r+")
@async begin
    write(gz, s)
    close(gz.in)
end
zipped = read(gz)

s3_put(bucket, "test.json.gz", zipped, "application/json", "gzip")
s3_get(bucket, "test.json.gz")

Here, s3_get throws an error as JSON.jl attempts to parse the gzipped data. This happens in practice with AWS CloudTrail logs, for example.

JuliaWeb/HTTP.jl#256 suggests having the HTTP client handle this transparently, but I don't know whether that's the right solution or not.

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