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:
parent
44ea61bced
commit
0a6ab3014c
1 changed files with 6 additions and 2 deletions
|
@ -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 ) )
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue