Changeset 8081


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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/rpc-server.c

    r8080 r8081  
    491491               || !strcmp( req->uri, "/" ) )
    492492        {
    493             evhttp_add_header( req->output_headers, "Location",
    494                                "/transmission/web/" );
     493            const char * protocol = "http";
     494            const char * host = evhttp_find_header( req->input_headers, "Host" );
     495            const char * uri = "transmission/web/";
     496            char * location = tr_strdup_printf( "%s://%s/%s", protocol, host, uri );
     497            evhttp_add_header( req->output_headers, "Location", location );
    495498            send_simple_response( req, HTTP_MOVEPERM, NULL );
     499            tr_free( location );
    496500        }
    497501        else if( !strncmp( req->uri, "/transmission/web/", 18 ) )
Note: See TracChangeset for help on using the changeset viewer.