content-encoding

Setting iso-8859-1 instead of utf-8 in oscommerce / sts template website?

孤街浪徒 提交于 2019-12-25 00:13:44
问题 In an oscommerce site I have the following: Server response = Content-type: text/html;charset=UTF-8 and I want: Content-type: text/html;charset=ISO-8859-1 How and where do I set this up. Html looks like this on the page: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html dir="LTR" lang="nl"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> Changing it to: utf-8 doesnt solve the problem. 回答1: in an .htaccess file AddDefaultCharset ISO-8859-1

How to serve already gzipped content in JAX-RS?

余生长醉 提交于 2019-12-24 03:38:06
问题 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 of webjars.org. Thus, I need to handle the Accept-Encoding header and check if the .gz is there (or not). So far, what I have is: @Path("res/{path:.*}") @GET public Response webjars(@PathParam("path") String path, @HeaderParam("Accept-Encoding")

Replacement for HttpResponse.ContentEncoding ASP.NET 5

妖精的绣舞 提交于 2019-12-20 01:58:19
问题 Does anyone know if there is a replacement in ASP.NET 5 for HttpResponse.ContentEncoding? https://msdn.microsoft.com/en-us/library/system.web.httpresponse.contentencoding(v=vs.110).aspx 回答1: Example: var mediaType = new MediaTypeHeaderValue("application/json"); mediaType.Encoding = Encoding.UTF8; httpContext.Response.ContentType = mediaType.ToString(); 回答2: Microsoft.Framework.WebEncoders.EncoderExtensions have HtmlEncode, JavaScriptStringEncode and UrlEncode extensions and the base Class is

Node.js proxy, dealing with gzip DEcompression

爱⌒轻易说出口 提交于 2019-12-19 04:07:29
问题 I'm currently working on a proxy server where we in this case have to modify the data (by using regexp) that we push through it. In most cases it works fine except for websites that use gzip as content-encoding (I think), I've come across a module called compress and tried to push the chunks that I receive through a decompress / gunzip stream but it isn't really turning out as I expected. (see below for code) figured i'd post some code to support my prob, this is the proxy that gets loaded

IIS content-type wrong for compressed CSS

荒凉一梦 提交于 2019-12-18 07:02:54
问题 I develop part of an ASP.NET site that uses mostly themes but has a couple of CSS files in the themes folder. These are included in the web.config by another developer like so: <Content Include="App_Themes\SoftOrange\CMSStyles.css" /> <Content Include="App_Themes\SoftOrange\ContentStyles.css" /> On our internal test server (IIS7, Server 2008 R2 Enterprise) the global IIS manager options for static and dynamic compression are on, for files larger than 2700 bytes. The site-specific static and

Android: HTTP communication should use “Accept-Encoding: gzip”

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-17 03:21:13
问题 I've a HTTP communication to a webserver requesting JSON data. I'd like compress this data stream with Content-Encoding: gzip . Is there a way I can set Accept-Encoding: gzip in my HttpClient? The search for gzip in the Android References doesn't show up anything related to HTTP, as you can see here. 回答1: You should use http headers to indicate a connection can accept gzip encoded data, e.g: HttpUriRequest request = new HttpGet(url); request.addHeader("Accept-Encoding", "gzip"); // ...

setting 'Content-Encoding' to gzip or deflate causes java.net.SocketException: Connection reset

杀马特。学长 韩版系。学妹 提交于 2019-12-13 07:45:40
问题 I have developed a simple Java Servlet in order to retrieve a medical file(DICOM) from a server: public class DicomRetrieveServlet extends HttpServlet { private static Logger log = Logger.getLogger(DicomRetrieveServlet.class); public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String dicomFilepath = "PATH TO MY FILE"; InputStream resultInStream = null; response.setHeader("Accept-Ranges","bytes"); response.setHeader("Vary",

JMeter - HTTP Request's Content Encoding field has no effect

爱⌒轻易说出口 提交于 2019-12-13 03:14:34
问题 I tried sending encoding in HTTP Request's Content Encoding field but it doesn't seem to have any effect also in POST request Content encoding to be used (for POST, PUT, PATCH and FILE). This is the character encoding to be used, and is not related to the Content-Encoding HTTP header. I found an answer in archive stating to use HTTP Header Manager instead HTTP Request sampler's Content Encoding field is related to Accept-Charset header. UTF-8, UTF-16, ISO-8859-1, etc. If you want to allow

Why does ob_start('ob_gzhandler') break this website?

自作多情 提交于 2019-12-10 16:44:50
问题 I've got a site that throws a Content Encoding Error in the browser if a ob_start('ob_gzhandler') is present. If I remove the statement, it runs fine. The site runs off the same framework, server and hosting package as a number of other sites. They all work, regardless of if the statement is in there. The statement is in the framework, not the application code, so it is shared by all of the sites. There's no difference in the configuration between the working sites and non working site. The

HTTP content encoding, base64

淺唱寂寞╮ 提交于 2019-12-10 13:43:29
问题 Is there any way to know if the message body of an HTTP response is encoded with Base64? I learnt that content-transfer-encoding is not part of HTTP header. So, which HTTP header indicates that the content is encoded with Base64? I think Content-encoding is only used for compressions. 回答1: As far as I understand, an HTTP body may not be encoded in Base64: HTTP does not use the Content-Transfer-Encoding (CTE) field of RFC 2045. Proxies and gateways from MIME-compliant protocols to HTTP MUST