- fix: Adding HTTP Proxy
This commit is contained in:
parent
255ec42344
commit
1ddeea9b39
2 changed files with 6 additions and 5 deletions
|
|
@ -17,6 +17,7 @@
|
|||
- fix: Incorrect method call in Auth.pm
|
||||
- fix: No Help link icon in Matrix edit page
|
||||
- fix: Problems with In/Out Board (labeling only)
|
||||
- fix: Adding HTTP Proxy
|
||||
|
||||
|
||||
6.99.3
|
||||
|
|
|
|||
|
|
@ -227,17 +227,17 @@ sub purgeCache {
|
|||
sub view {
|
||||
my $self = shift;
|
||||
my $cookiebox = $self->session->url->escape($self->session->var->get("sessionId"));
|
||||
my $requestMethod = $self->session->env->get("REQUEST_METHOD");
|
||||
$cookiebox =~ s/[^A-Za-z0-9\-\.\_]//g; #removes all funky characters
|
||||
$cookiebox .= '.cookie';
|
||||
my $jar = HTTP::Cookies->new(File => $self->getCookieJar->getPath($cookiebox), AutoSave => 1, Ignore_Discard => 1);
|
||||
my (%var, %formdata, @formUpload, $redirect, $response, $header, $userAgent, $proxiedUrl, $request);
|
||||
|
||||
if($self->session->form->process("func")!~/editSave/i) {
|
||||
if($self->session->form->param("func")!~/editSave/i) {
|
||||
$proxiedUrl = $self->session->form->process("FormAction") || $self->session->form->process("proxiedUrl") || $self->get("proxiedUrl") ;
|
||||
} else {
|
||||
$proxiedUrl = $self->get("proxiedUrl");
|
||||
$self->session->stow->set("REQUEST_METHOD", 'GET');
|
||||
$self->session->errorHandler(Dumper($self->session->{_env}));
|
||||
$requestMethod = "GET";
|
||||
}
|
||||
|
||||
$redirect=0;
|
||||
|
|
@ -248,7 +248,7 @@ sub view {
|
|||
my $cachedHeader = WebGUI::Cache->new($self->session,$proxiedUrl,"HEADER");
|
||||
$var{header} = $cachedHeader->get;
|
||||
$var{content} = $cachedContent->get;
|
||||
unless ($var{content} && $self->session->stow->get("REQUEST_METHOD")=~/GET/i) {
|
||||
unless ($var{content} && $requestMethod=~/GET/i) {
|
||||
$redirect=0;
|
||||
until($redirect == 5) { # We follow max 5 redirects to prevent bouncing/flapping
|
||||
$userAgent = new LWP::UserAgent;
|
||||
|
|
@ -270,7 +270,7 @@ sub view {
|
|||
$header = new HTTP::Headers;
|
||||
$header->referer($self->get("proxiedUrl")); # To get around referrer blocking
|
||||
|
||||
if($self->session->stow->get("REQUEST_METHOD")=~/GET/i || $redirect != 0) { # request_method is also GET after a redirection. Just to make sure we're
|
||||
if($requestMethod=~/GET/i || $redirect != 0) { # request_method is also GET after a redirection. Just to make sure we're
|
||||
# not posting the same data over and over again.
|
||||
if($redirect == 0) {
|
||||
foreach my $input_name ($self->session->form->param) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue