Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#1944 closed Bug (fixed)

Web Client 301 redirect violates specification

Reported by: spil Owned by: Gimp
Priority: Normal Milestone: 1.52
Component: Web Client Version: 1.51
Severity: Normal Keywords:


Transcript of session

# telnet 9091
Connected to localhost.
Escape character is '^]'.
GET / HTTP/1.1

HTTP/1.1 301 Moved Permanently
Server: Transmission
Location: /transmission/web/
Date: Mon, 23 Mar 2009 09:58:23 GMT
Content-Length: 31
Content-Type: text/html; charset=ISO-8859-1

<h1>301: Moved Permanently</h1>

The Location header returned violates the HTTP/1.1 specification Section 14.30 Location specifies: "The field value consists of a single absolute URI."

The webserver must in return the header Location:

transmission-daemon-1.51 built from ports running on FreeBSD 7.1/i386

Change History (5)

comment:1 Changed 13 years ago by charles

  • Resolution set to wontfix
  • Status changed from new to closed

I wonder what the correct solution for this is. I don't see a good way of getting the public IP address out of evhttp for using as the domain here.

Is this actually breaking on any browser?

If someone submits a patch for this, I'd be inclined to use it, but as things are now the relaxed usage of 301 doesn't seem to be causing any harm.

comment:2 Changed 13 years ago by spil

  • Resolution wontfix deleted
  • Status changed from closed to reopened

The fix is to use the Host: header from the HTTP request, and the protocol that you've bound on (always http for transmission-web I guess) Create the Location header from the <protocol>:<Host-header>/URI

Original Request from the browser is:

GET / HTTP/1.1

Apache will request at the daemon:9901 :

GET / HTTP/1.1

You're working on a http request, so the reply from the daemon should be:

HTTP/1.1 301 Moved Permanently
Server: Transmission

Apache will then rewrite the Location part for you in the reply that is sent to the client (provided that the correct ProxyPassReverse? is in place):

HTTP/1.1 301 Moved Permanently
Server: Transmission

comment:3 Changed 13 years ago by charles

spil: the host header did the trick. Thanks for the pointer.

Fixed in trunk in r8081.

comment:4 Changed 13 years ago by charles

  • Milestone changed from None Set to 1.52
  • Resolution set to fixed
  • Status changed from reopened to closed

comment:5 Changed 13 years ago by charles

Fixed in 1.5x branch in r8082.

Note: See TracTickets for help on using tickets.