Questions tagged [content-encoding]

Use this tag for questions regarding specifying content encoding on HTTP requests.

A concept in HTTP/1.1 content negotiation to indicate encryption or compression of an HTTP response (such as gzip support).

The following headers are typically used to determine the content encoding of a response. However, servers are free to use other aspects they choose.

  • Accept
  • Accept-Charset
  • Accept-Encoding
  • Accept-Language
  • User-Agent

Typical values of the Transfer-Encoding header: gzip, compress, deflate, identity, *

155 questions
2
votes
0 answers

What does setting Content-Encoding to true do?

I've come across this line in some PHP code I've inherited: header('Content-Encoding: ', true); Looking at the MDN docs for Content-Encoding 'true' is not a valid value. It is expecting something like gzip or deflate, not true. I also looked and I…
user911625
2
votes
2 answers

Google cloud storage gzip compression, wrong headers

Just started using google cloud storage. I am having problem receiving gzip files from it. Stored file is gzip'ed but it gets decompressed on request. I have read all documentation, forums and have tried dozens of different combinations of headers…
2
votes
0 answers

X-Content-Type-Options: nosniff on Internet Explorer

After setting Header set X-Content-Type-Options "nosniff" , images being served from Amazon S3 on Internet Explorer do not load any more. What could be the root cause of this issue? Thanks.
2
votes
1 answer

How to serve already gzipped content in JAX-RS?

I'm developing a small JAX-RS application with Resteasy. I wanted the application to serve some static content for Javascript and CSS files, etc. and I would like to take advantage of the already gzipped version of the resources packaged in the jars…
Martín Schonaker
  • 7,273
  • 4
  • 32
  • 55
2
votes
2 answers

Can SVG render partially if gzipped and chunk-transferred?

I have some large, dynamically generated SVGs that are being served over a relatively slow internet connection. I'm trying to optimize them to be viewable as fast as possible. If I set the server to Content-Encoding: gzip and Transfer-Encoding:…
Scott Stafford
  • 43,764
  • 28
  • 129
  • 177
2
votes
4 answers

Wrong encoding when displaying an HTML Request in Python

I do not understand why when I make a HTTP request using the Requests library, then I ask to display the command .text, special characters (such as accents) are encoded (é = é for example). Yet when I try r.encoding, I get utf-8. In addition,…
Delgan
  • 18,571
  • 11
  • 90
  • 141
2
votes
1 answer

PHP ob_gzhandler, setting Content-Length disables gzipped output

I read some articles about setting the content-length of a file that will be served. It has some benefits comparing to chunked downloads. The server serve chunks (don't know what the size of a chunk is anyway) when the content-length is unknown. In…
Codebeat
  • 6,501
  • 6
  • 57
  • 99
2
votes
1 answer

How do I differentiate between request and response in an HTTPURLConnection?

Hi I need to evaluate if a server supports gzip compression. Therefore I want to set gzip as Accept-Encoding in my request and evaluate if the response of the server containts "Content-Encoding: gzip". However I am not quite clear on how to do this…
er4z0r
  • 4,711
  • 8
  • 42
  • 62
2
votes
1 answer

How to set the content type and content encoding when uploading to S3?

I am uploading some files to the S3 buckets. One zip file, one .json file. When I upload them, both files will have: Content-Type: application/octet-stream I need the zip files to have: Content-Type: text/plain Content-Encoding: gzip What do I…
iCodeLikeImDrunk
  • 17,085
  • 35
  • 108
  • 169
1
vote
1 answer

Ordering of multiple values in content-encoding header in http request

I am getting request header 'content-encoding : gzip, br' in a http request so it is having multiple values in content-encoding header. Is the order of these values telling me the order in which compression was done on the request body or is it…
Vaibhav
  • 169
  • 6
1
vote
1 answer

Encoding in JSF 2 + Tomcat 7

I have one form with only one single field. When I submit the form, the value of my field becomes strange. The word Extremação becomes Extremação. So, I already set UTF-8 encoding in every place on my app:
1
vote
0 answers

Content-encoding in the Header of index page of Apache 2.4

I have Apache 2.4.37 without Nginx and with PHP 7.2.24. When I download header of my site: $ curl -I -H "Accept-Encoding: gzip" https://mysite/ HTTP/2 200 server: Apache/2.4.37 (centos) OpenSSL/1.1.1k x-powered-by: PHP/7.2.24 expires: Thu, 19 Nov…
DimaGra
  • 11
  • 1
1
vote
1 answer

Jetty removes Content-Encoding: gzip header

I'm using Jetty 6.1 together with PJL Compressing Filter. Jetty removes the following header from the response: Content-Encoding: gzip This causes that most browsers cannot display the page anymore and show something like this: Error 330…
Bob
  • 5,510
  • 9
  • 48
  • 80
1
vote
2 answers

Content-Transfer-Encoding: quoted-printable is breaks the break lines

I´m sending emails through a Rails web app using AmazonSes service. I´m sending different types of emails and everything is working fine, but in the next scenario: The user can write a text like a message with line breaks in a textarea field within…
Rober
  • 5,868
  • 17
  • 58
  • 110
1
vote
3 answers

HTML & CSS: Turn fonts and images into data strings

How can I convert fonts and images (assets in general) to data attributes? Would assets load faster or slower this way?
Francisc
  • 77,430
  • 63
  • 180
  • 276