Changeset 8082


Ignore:
Timestamp:
Mar 24, 2009, 5:13:37 PM (13 years ago)
Author:
charles
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.5x/libtransmission/rpc-server.c

    r7767 r8082  
    489489               || !strcmp( req->uri, "/" ) )
    490490        {
    491             evhttp_add_header( req->output_headers, "Location",
    492                                "/transmission/web/" );
     491            const char * protocol = "http";
     492            const char * host = evhttp_find_header( req->input_headers, "Host" );
     493            const char * uri = "transmission/web/";
     494            char * location = tr_strdup_printf( "%s://%s/%s", protocol, host, uri );
     495            evhttp_add_header( req->output_headers, "Location", location );
    493496            send_simple_response( req, HTTP_MOVEPERM, NULL );
     497            tr_free( location );
    494498        }
    495499        else if( !strncmp( req->uri, "/transmission/web/", 18 ) )
Note: See TracChangeset for help on using the changeset viewer.