http-headers

How to update Http Request and send it to another web server

Following is our environment setup: IIS 7 receives Http (.jsp) request from client (browser). It blindly redirects it to JBoss using ISAPI_Redirect.dll. Now we are trying to modify this setup in such a way that before IIS7/ISAPI_redirect sends it to JBoss, we need to modify posted form data using Http module. This http module is normal...

How do I make PayPal and cURL work together?

THE BACKGROUND DETAILS: I have a custom shopping cart that uses PayPal for payment processing. I have an intermediary page between the cart and PayPal that adds the order to a database and sends confirmation emails. Until now, I had the intermediary page set up to include all the necessary data as hidden form fields and submit the form...

how to decode HTTP request headers and body in Python 3?

i am writing an experimental asynchronous web server. i am wondering about the standard / 'best' way to decode HTTP requests in python? basically what reading from the socket gives me is a bytes representation of the incoming request raw data; how can i turn these into standard datatypes like dictionaries, lists of values, and so on? i...

Django and dynamically generated images

I have a view in my Django application that automatically creates an image using the PIL, stores it in the Nginx media server, and returns a html template with a img tag pointing to it's url. This works fine, but I notice an issue. For every 5 times I access this view, in 1 of them the image doesn't render. I did some investigation and...

Checking for a pattern and rewriting in the same operation in nginx config files

I make use of version numbers to cache static files, with URLs like this: http://example.com/css/example.v123.css Combined with a nginx config snippet like this: # Serve static files directly location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico)$ { root /var/www/example.com/static/; access_log off; if ($request_filename ~* ^(.*\....

Is there no way to access the asp.net Response.Headers in IIS6?

When I try to access Request.Headers I get a "This operation requires IIS integrated pipeline mode." error. Is there really no way to view the response headers in .net with IIS6? ...

Header location not working properly

I have a php script that renders an image (with imagick) and saves it to some directory "SITE_ROOT.$filePath", then does a header('Location: ' . SITE_ROOT.$filePath), the file it redirects to is a png image. If I go to the path directly, like just type it in the URL bar I can save the image and everything works fine, however when I rel...

CFHTTPMessageSetHeaderFieldValue - Failing for unknown reasons

CFHTTPMessageSetHeaderFieldValue is silently failing for me on certain parameters without warning or error. The header's value is simply not set. Header Key: Authorization Header Value: GoogleLogin auth=DQAAAJAAAAAIuG7Ki5ZtvxH9NyZU3NRK5IexJOASkWOnMaH2f42WerL0omocuQycif3ub8AorRnDERJV9An2_Js4hqigOyLzkrV5r6ZSnWn8FbXZQNn37HZjmS0rDGzS1A...

Getting a Request.Headers value

Very simple I'm sure, but driving me up the wall! There is a component that I use in my web application that identifies itself during a web request by adding the header "XYZComponent=true" - the problem I'm having is, how do you check for this in your view? The following wont work: if (Request.Headers["XYZComponent"].Count() > 0) Nor...

How to set Expires HTTP header on a single JS file in Apache Tomcat?

Hi, I have a js file which is cached between 5-10 minutes, depending on whether I'm using tomcat from the eclipse (via GWT plugin) or starting tomcat as standalone. This is strange as I'm using GWT as my framework and this file should not be cached at all (it's a nocache.js file to those of you who know GWT). I've read on a GWT Google gr...

Where do the HTTP header fields come from in PHP output (apart from header())

I have a PHP script that reads a file and outputs it to the client. It's a CSS file, so I've used header() to set Content-Type, Content-Length and Cache-Control. If I add a made-up header, I can see it using Tamper Data so it seems that basically it's working (and the file is received fine by the browser). What I don't understand is that...

Modify Java SWT Browser User-agent

How is it possible to set the user agent header sent by SWT Browser? edit: Or is there any browser lib for java that allows specifying the user agent? ...

Alternative to "Referer" Header

I have used the code "request.getHeader("Referer");" The code seemed to work fine. But recently I found out that it is not working in IE. IE was throwing null. I am now left clueless about how to go forward. Is there any alternative for "Referer" header which can get the previous link and work correctly in all the browsers? Setting a cu...

header('location: ..') not working

(1)I'm in the process of uploading my website to a remote web server. (2)The site's template system is set up in a way that all of the pages are formed by sending url-encoded get requests to index.php (3)Loading up the initial page works. This page determines the location of the next page by evaluating the value of its form. (4)The r...

Best possible SEO way of forcing the iframe'd page to reload as parent.

<html> <iframe src="iWantToBeTheParent.html" /> </html> I think this is a JavaScript task, it would be nice to handle the redirection with htaccess though since my code will inside an iframe I'm looking for a method that initiates from inside the iframe source which would make the iframe url load as the parent. I only have access t...

Custom HTTP headers : naming conventions

Several of our users have asked us to include data relative to their account in the HTTP headers of requests we send them, or even responses they get from our API. What is the general convention to add custom HTTP headers, in terms of naming, format... etc. Also, feel free to post any smart usage of these that you stumbled upon on the w...

Python, mechanize, proper syntax for setting multiple headers?

I can't seem to find how to do this anywere, I am trying to set multiple headers with python's mechanize module, such as: br.addheaders = [('user-agent', ' Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.3) Gecko/20100423 Ubuntu/10.04 (lucid) Firefox/3.6.3')] br.addheaders = [('accept', 'text/html,application/xhtml+xml,application/xm...

SharePoint 2010 / IIS 7.5 Byte-Range Request Responds With Entire File

Hello, I'm having problems getting SharePoint 2010/IIS 7.5 to respect byte-range requests. I'm developing a SharePoint 2010 Web Part using Silverlight, and am trying to retrieve part of a document stored inside SharePoint. When I request a byte range of a file in SharePoint, the server responds with the entire file. However, if I reque...

"Cache-Control: Max-age=0" in IIS 6.0

Hello, I've configured my IIS 6.0 load-balanced website to have empty ETag headers, per what YSlow recommends for load-balanced websites. Both before AND after I configued this empty ETag header, I got all images being cached on the client side, but with primed cache it was still checking for new versions on the server and returning a ...

Is it possible to load an image with JQuery and specify Accept HTTP header?

I'm trying to load an image with JQuery like so: function loadImage( path ) { var img = new Image(); $(img) .error(function () { alert('Error loading image'); }) .attr('src', path ); } I'm wondering if I am able to change the Accept HTTP header before the image is loaded because the API for the images requires it. ...