1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-02-03 21:12:05 +00:00

(trunk libT) #1944: Web Client 301 redirect violates w3c.org specification

This commit is contained in:
Charles Kerr 2009-03-24 17:11:53 +00:00
parent 44ea61bced
commit 0a6ab3014c

View file

@ -490,9 +490,13 @@ handle_request( struct evhttp_request * req,
|| !strcmp( req->uri, "/transmission/clutch" )
|| !strcmp( req->uri, "/" ) )
{
evhttp_add_header( req->output_headers, "Location",
"/transmission/web/" );
const char * protocol = "http";
const char * host = evhttp_find_header( req->input_headers, "Host" );
const char * uri = "transmission/web/";
char * location = tr_strdup_printf( "%s://%s/%s", protocol, host, uri );
evhttp_add_header( req->output_headers, "Location", location );
send_simple_response( req, HTTP_MOVEPERM, NULL );
tr_free( location );
}
else if( !strncmp( req->uri, "/transmission/web/", 18 ) )
{