http-headers

X-Robots noindex specific page in .htaccess

◇◆丶佛笑我妖孽 提交于 2019-12-05 09:05:28
Can I 'noindex, follow' a specific page using x robots in .htaccess? I've found some instructions for noindexing types of files, but I can't find instruction to noindex a single page, and what I have tried so far hasn't worked. This is the page I'm looking to noindex: http://www.examplesite.com.au/index.php?route=news/headlines This is what I have tried so far: <FilesMatch "/index.php?route=news/headlines$"> Header set X-Robots-Tag "noindex, follow" </FilesMatch> Thanks for your time. It seems to be impossible to match the request parameters from within a .htaccess file. Here is a list of what

Extracting Information from a Tuple (Python)

℡╲_俬逩灬. 提交于 2019-12-05 08:54:06
I'm currently using the httplib library in Python 2.7 to obtain some headers from a website to establish a) the filesize of a download and b) the last modified date of the file. I've used some online tools and these details do exist. I'm currently scripting my Python code and it appears to work correctly bringing back the required information. Nonetheless, the response containing the header information is a list containing a number of tuples. A sample of the response is below:- [('content-length', '2501479'), ('accept-ranges', 'bytes'), ('vary', 'Accept-Encoding'), ('server', 'off'), ('last

SOAP headers versus HTTP headers

谁都会走 提交于 2019-12-05 08:43:49
问题 I am working on a program using web services and for that I need to wrap some data as headers for the message. I want to ask if it is equivalent to place this data as SOAP headers or as HTTP headers? 回答1: The SOAP headers contain application specific information related to the SOAP message. They typically contain routing information, authentication information, transaction semantics etc. These are specific to the SOAP message and are independent of the transport that SOAP uses (in the scope

What is the HTTP “content-type” to use for a blob of bytes?

时光毁灭记忆、已成空白 提交于 2019-12-05 08:31:26
问题 What is the HTTP "content-type" to use when returning a blob of bytes in response to a client's GET request? In this case, the information payload is an object serialized using Python's Pickle library. 回答1: You should use application/octet-stream . 回答2: You should use the proper mime type: application/python-pickle This is the de-facto standard (this mean: it is not application/pickle or application/pickle-python). RFC2046 states: 4.5.3. Other Application Subtypes It is expected that many

jersey.api.client.WebResource - how to debug/log the request headers

江枫思渺然 提交于 2019-12-05 08:27:15
I am using jersey to generate http requests and I would like to be able to see the request before it is sent (for debugging purposes). For example: WebResource resource = client.resource(url); resource.header("aa", "bb"); resource.getHeaders(); // Error: how can I do it? thanks ivan.cikic You can use LoggingFilter , as shown here You need to add init-params and then implement ContainerRequestFilter Put it in your web.xml Please note that com.az.jersey.server.AuthFilter is your class that has implemented mentioned above interface. <init-param> <param-name>com.sun.jersey.spi.container

PHP: close output stream

为君一笑 提交于 2019-12-05 07:57:59
Is it possible to close the output stream of a PHP script? I have a script which needs to do some post processing, but during and after the post processing it won't send any data to the client anymore, so I'd like to close the connection before the post processing. Edit: In my application I have a cache which needs to be rebuild every now and then. However, I don't want to slow a user down. What I want is to determine at the end of the script if the cache needs to be rebuild. So I want to close the output stream first, so the user gets it's data, and then I want to rebuild the cache. It isn't

How to prevent HttpClient from sending the Connection header

…衆ロ難τιáo~ 提交于 2019-12-05 07:54:50
HttpClient includes this as 'Keep-Alive' by default. I've been able to set it to 'Close' using httpClient.DefaultRequestHeaders.ConnectionClose = true; but how do I omit it altogether? I've seen this asked before and to my knowledge no one ( not even the great Jon Skeet ) has come up with a way to avoid sending the Connection header in the HttpClient or HttpWebRequest worlds without completely reinventing the wheel. It's happening somewhere very deep down in the weeds. ConnectionClose is nullable, but setting it to null on both HttpClient.DefaultRequestHeaders AND HttpRequestMethod.Headers

“Content-encoding” header disappears from HttpHandler response if an exception occurs

别说谁变了你拦得住时间么 提交于 2019-12-05 07:42:12
I have a custom HttpHandler in which I manually enable output compression, like so: context.Response.AppendHeader("Content-encoding", "gzip"); context.Response.Filter = new GZipStream(context.Response.Filter, CompressionMode.Compress); This works nicely for most requests, but when an exception is encountered the "Content-encoding" header disappears from the response, while the compression filter remains in place. The result is that the error page is gzip compressed, but the browser receives no header indicating that fact. The browser then tries to display the still-compressed data as text,

Play Framework 2.3.x ByteChunks MP3 streaming has no playback, is not 'scrollable' in the browser

耗尽温柔 提交于 2019-12-05 06:55:34
问题 Using Play Framework (version 2.3.x ) (Java style), I am trying to serve an .mp3 file to the browser. Since it is a 'large' file I have decided to go with Play's ByteChunks Object, as follows. @With(MP3Headers.class) public static Result test() { Chunks<byte[]> chunks = new ByteChunks() { public void onReady(Chunks.Out<byte[]> out) { try { byte[] song = Files.readAllBytes(Paths.get("public/mp3/song.mp3")); out.write(song); } catch(Exception e) { e.printStackTrace(); } finally { out.close(); }

Multiple distinct Content-Disposition headers received from server in Jasperreports

↘锁芯ラ 提交于 2019-12-05 06:30:57
I'm trying to set content-disposition header in response of servlet, but i get this error in browser. What should i do? Duplicate headers received from server The response from the server contained duplicate headers. This problem is generally the result of a misconfigured website or proxy. Only the website or proxy administrator can fix this issue. Error 349 (net::ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION): Multiple distinct Content-Disposition headers received. This is disallowed to protect against HTTP response splitting attacks. Here my servlet controller: @RequestMapping("/**