- Timestamp:
- 05/30/13 15:15:05 (11 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BookmarkApp.pm
r40 r41 11 11 use Bookmarks; 12 12 use URI; 13 14 my $dbname = 'fk.db';15 13 16 14 sub setup { … … 24 22 edit 25 23 }]); 24 26 25 my $base_uri = URI->new; 27 26 $base_uri->scheme('http'); 28 $base_uri->host($ENV{ HTTP_X_FORWARDED_HOST} || $ENV{SERVER_NAME});27 $base_uri->host($ENV{SERVER_NAME}); 29 28 $base_uri->port($ENV{SERVER_PORT}); 30 29 $base_uri->path($ENV{SCRIPT_NAME} . '/'); 31 30 32 31 my $bookmarks = Bookmarks->new({ 33 dbname => $ dbname,32 dbname => $self->param('dbname'), 34 33 base_uri => $base_uri, 35 34 }); -
trunk/index.cgi
r30 r41 19 19 20 20 package main; 21 BookmarkApp::Dispatch->dispatch(); 21 # check for whether we are behind a reverse proxy, and adjust the SERVER_NAME accordingly 22 # TODO: use something like Plack::Middlware::ReverseProxy instead 23 $ENV{SERVER_NAME} = $ENV{HTTP_X_FORWARDED_HOST} if $ENV{HTTP_X_FORWARDED_HOST}; 24 25 BookmarkApp::Dispatch->dispatch( 26 args_to_new => { 27 #TODO: dbname should be in a config file 28 PARAMS => { dbname => 'fk.db' }, 29 } 30 );
Note: See TracChangeset
for help on using the changeset viewer.