Skip to content

Commit

Permalink
MT7417:Webservices would not work in a proxied environmnent
Browse files Browse the repository at this point in the history
In a proxied Environment, the web service would not be reachable.
To test it, you need a reachable proxy server.
You have to setup CGI_HTTP_PROXY environment variable in your apache configuration file in opac vhost.
SetEnv CGI_HTTP_PROXY="proxyurl:port"
  • Loading branch information
laurenthdl committed Sep 23, 2011
1 parent fa73ff8 commit 9be4e0f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion C4/External/Syndetics.pm
Expand Up @@ -259,7 +259,7 @@ sub _fetch_syndetics_content {
my $syndetics_client_code = C4::Context->preference('SyndeticsClientCode');

my $url = "http://www.syndetics.com/index.aspx?isbn=$isbn/$element&client=$syndetics_client_code&type=xw10&upc=$upc&oclc=$oclc";
my $ua = LWP::UserAgent->new;
my $ua = LWP::UserAgent->new(env_proxy=>1);
$ua->timeout(10);
$ua->env_proxy;
my $response = $ua->get($url);
Expand Down
2 changes: 1 addition & 1 deletion C4/Search/PazPar2.pm
Expand Up @@ -46,7 +46,7 @@ sub new {
my $self = {};
$self->{'endpoint'} = $endpoint;
$self->{'session'} = '';
$self->{'ua'} = LWP::UserAgent->new;
$self->{'ua'} = LWP::UserAgent->new(env_proxy=>1);
bless $self, $class;

return $self;
Expand Down
2 changes: 1 addition & 1 deletion C4/XISBN.pm
Expand Up @@ -142,7 +142,7 @@ sub get_xisbns {

sub _get_url {
my ( $url, $service_type ) = @_;
my $ua = LWP::UserAgent->new( timeout => 2 );
my $ua = LWP::UserAgent->new( timeout => 2, env_proxy=>1 );

my $response = $ua->get($url);
if ( $response->is_success ) {
Expand Down
2 changes: 2 additions & 0 deletions etc/koha-httpd.conf
Expand Up @@ -16,6 +16,7 @@
# TransferLog __LOG_DIR__/koha-opac-access_log
SetEnv KOHA_CONF "__KOHA_CONF_DIR__/koha-conf.xml"
SetEnv PERL5LIB "__PERL_MODULE_DIR__"
# SetEnv CGI_HTTP_PROXY "__PROXY_URL__:__PROXY_PORT__"

<IfModule mod_gzip.c>
mod_gzip_on yes
Expand Down Expand Up @@ -105,6 +106,7 @@
# TransferLog __LOG_DIR__/koha-access_log
SetEnv KOHA_CONF "__KOHA_CONF_DIR__/koha-conf.xml"
SetEnv PERL5LIB "__PERL_MODULE_DIR__"
# SetEnv CGI_HTTP_PROXY "__PROXY_URL__:__PROXY_PORT__"
Options +FollowSymLinks

ErrorDocument 400 /cgi-bin/koha/errors/400.pl
Expand Down
2 changes: 1 addition & 1 deletion misc/cronjobs/check-url.pl
Expand Up @@ -83,7 +83,7 @@ sub new {
my $self = {};
my ( $class, $timeout ) = @_;

my $uagent = new LWP::UserAgent;
my $uagent = LWP::UserAgent->new(env_proxy=>1);
$uagent->timeout($timeout) if $timeout;
$self->{user_agent} = $uagent;
$self->{bad_url} = {};
Expand Down

0 comments on commit 9be4e0f

Please sign in to comment.