google / guava

Google core libraries for Java
Apache License 2.0
50.07k stars 10.87k forks source link

application/gzip media type missing in MediaType #3946

Open breucode opened 4 years ago

breucode commented 4 years ago

According to https://tools.ietf.org/html/rfc6713, media types like application/x-gzip should not be used any more, since they are non standard. However, in the MediaType class of guava, GZIP is defined as this MediaType GZIP = createConstant(APPLICATION_TYPE, "x-gzip");. In my opinion, this encourages the usage of "deprecated" mimetypes in a lot of applications.

Simply replacing the current constant might be a problem though, so it make make sense to introduce application/gzip as an additional mimetype.

kluever commented 4 years ago

Interesting - we may want to deprecate the old constant and provide a new one (it's unlikely that we could just change it in place).

somayaj commented 2 years ago

@cpovirk what should it be named? the final constant for GZIP?

@Deprecated public static final MediaType GZIP = createConstant(APPLICATION_TYPE, "x-gzip");

public static final MediaType GZIP = createConstant(APPLICATION_TYPE, "gzip"); // we need a name here