http-headers

How to support backwards compatibility with the changes to the Accept header handling in Rails 2.3.4

In Rails 2.3.4, the way Accept headers are handled has changed: http://github.com/rails/rails/commit/1310231c15742bf7d99e2f143d88b383c32782d3 We won't Accept it The way in which Rails handles incoming Accept headers has been updated. This was primarily due to the fact that web browsers do not always seem to know what they want ...

downloading a file with a different name with php

Hi maybe this is ridiculous but i wonder if it is possible to let your user to download a file with a different name. for example; there is a file called "4324ffsd34.jpg" and i want ppl to download it by download.php, with a different name( like "filetodownload.jpg" ). without renaming original file. is that possible in any way? th...

HTTP headers from some clients have characters randomly replaced

Doing web traffic and log analysis, but there are a lot of malformed headers being passed from clients. These have characters transposed or replaced with "x"'s. Does anyone know where they come from or why? Is this some kind of attempt at security, or something more nefarious? Examples: xroxy-connection: Keep-Alive cneoction: close n...

Redirect with Curl/HttpClient: header "Location" missing.

Hi all, when I get the following url with curl curl -D headers.http "http://www.springerlink.com/index/10.1007/s00453-007-9157-8" the file headers.http contains a "Location" header: HTTP/1.1 302 Found Date: Tue, 27 Oct 2009 17:00:20 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET X-AspNet-Version: 2.0.50727 Location: http://www.s...

add custom http header to subdirectories

here is the code i am using cscript adsutil.vbs set w3svc/1/ROOT/Test/css/HttpCustomHeaders "Cache-Control: max-age=36000" when i use it an error appears The path requested could not be found. ErrNumber: -2147024893 (0x80070003) Error Trying To Get the Object: w3svc/1/ROOT/Test/css w3svc/1/ROOT/Test is the virtual directory i wa...

Timezone for Expires and Last-Modified HTTP Headers

This is a question regarding the timezone specified in the Expires and Last-Modified HTTP headers. In most of the examples I have seen, I always see GMT as the specified timezone in the HTTP headers. e.g. Last-Modified: October 21, 2009 00:00:00 GMT Expires: October 28, 2009 00:00:00 GMT Do you know if the browser only understands G...

https caching of resources used by main php script, NOT the script itself

I'm a little confused here. I read some of the earlier questions on https caching but I didnt get a clear answer. I've got a script sitting on: https://www.example.com/main.php It generates an html page that refers to images/css/js resources sitting (relatively) at: /css /javascript /images /a/b/img2 How do I enable caching for these...

IE accept headers changing, why?

I am trying to debug an issue on my server side and I believe it has to do with the accept headers that are being sent from the browser. Here is my question, why would Internet Explorer change "accept" headers from one page to another page? Can I change the request headers from javascript? Here is a request from one page: Accept: ima...

HTTP MODIFY verb for REST ?

As far as I see, there's no RESTful way to apply a modification to a resource. In order to do it, you have to PUT the resource as a whole, overwriting the previous representation. I think this is source of problems, in particular when the resource has a large representation. I believe this hints at the lack of a verb in HTTP1.1 : somet...

How to set Accept-Language header on request from applet

Hi, I'm not familiar with Java but I need to make a request to a remote webservice from within my applet. The webservice (.Net 1.1) uses HttpContext.Current.Request.UserLanguages[0] to determine the language to use. But the value of this member is alway null. So is there a way to pass the Accept-Language header along with something li...

IE behaving weirdly.

Hi, We are setting Window.Location through JavaScript depending on the value selected by the user in a dropdown. The url we are setting the location to does not have HTTP Caching set up explicitly. However, we have observed that in certain cases, the expires header is set in the future by 1 second. Whenever this happens, changing windo...

What is the difference between HttpContext.Current.Response and Page.Response?

I'm troubleshooting a caching issue on a set of secured pages and have realized that the Header needs to be modified for all Responses. As I put together a solution, I want to know the difference between HttpContext.Current.Response and Page.Response and when each object should be used in an app. Thanks. ...

How to set RESPONSE Headers globally using J2EE container (Websphere)

Is there a way, at the web server level (web.xml) to set headers for all transactions? Specifically, I would like to do this: response.setHeader("Cache-Control", "no-cache, no-store"); response.setDateHeader("Expires", -1); at the application level. I seem to recall that headers could be set in the Web.xml. Are there other solution...

Do HTTP request headers have to be UTF-8 encoded?

I could not find anything in the spec which says it should be. I have seen a couple of browsers setting their user-agents to non UTF8 encoded strings. There is however a Content-Type request header which specifies the media type (and charset), and I'm not sure if that is applicable only to the body of the request or the headers too. ...

how to send zipped (ASCII) data in an HTTP response from PHP

I am writing a service that sends data as a response, to a client. I am sending text (PLAIN ASCII) data, but I want to compress the data first (uzing any of the standard compression routines), and then send the compressed data back to the server, using the header() function etc. I am relatively new to PHP so having gathered the data, I...

Set Response format inside a function according to Accept header and not outside with ResponseFormat = WebMessageFormat.Json in REST

Hi there, i am using the Plain old XML template from WCF REST Starter Kit Preview 2 to build a REST service and i would like to set the ResponseFormat inside the OperationContract, not outside(not with ResponseFormat = WebMessageFormat.Json) because i want to set it accordingly to the Accept Header in the Request. and ideally i would lik...

To add more parameter for my http header for SSL/TLS

Hi, As far as I understand, https is http plus SSL/TLS. What do I need to do if I want to add 3 more parameters for the header? I found a file inside Mozilla's NSS - ssl3ext.c, but I don't understand it and don't know how to start. Need a clue from you guys.. Is this something about SSL/TLS extension? But it is far more complex right...

Using Python/Selenium/Best Tool For The Job to get URI of image requests generated through JavaScript?

I have some JavaScript from a 3rd party vendor that is initiating an image request. I would like to figure out the URI of this image request. I can load the page in my browser, and then monitor "Live HTTP Headers" or "Tamper Data" in order to figure out the image request URI, but I would prefer to create a command line process to do thi...

IE Sending OPTIONS Request for File Downloads

On my site I have a very basic setup: an 'a href' tag that just points to a file. Nothing fancy: <a href="/path/to/my/file.doc">File</a> No fancy javascript, nothing. Some users who are using old IE versions less than 8 have been having spotty problems downloading different files like this. What I've been able to trace it back to is t...

Is there a Firefox plug in which can list unsecure assets which are causing the "Warning: Contains unauthenticated content"

I am developing web pages which reference external links/images/stylesheets etc. I have 1 page which loads fine in HTTPS, but then when I apply different external styles, some of the external styles cause a warning "Contains unauthenticated content" Don't get me wrong, I understand WHAT this means, but I can't see any reference to any H...