summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2013-10-15 13:08:12 -0700
committerMark Wells <mark@freeside.biz>2013-10-15 13:08:12 -0700
commit859d1db13fc49b46bf1707d8fa429818fd9c97a9 (patch)
tree61c3cacfd399bae5d5e765974ddb2aac64c1431d /FS
parenta8a70873f47d54c50b4ccb74c56aba9ee8efc208 (diff)
compatibility fix for FFIEC census tract lookup, #25258
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/Misc/Geo.pm8
1 files changed, 5 insertions, 3 deletions
diff --git a/FS/FS/Misc/Geo.pm b/FS/FS/Misc/Geo.pm
index 42bf798ae..e5355cc27 100644
--- a/FS/FS/Misc/Geo.pm
+++ b/FS/FS/Misc/Geo.pm
@@ -6,6 +6,7 @@ use vars qw( $DEBUG @EXPORT_OK );
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Request::Common qw( GET POST );
+use HTTP::Cookies;
use HTML::TokeParser;
use URI::Escape 3.31;
use Data::Dumper;
@@ -41,13 +42,13 @@ sub get_censustract {
my $return = {};
my $error = '';
- my $ua = new LWP::UserAgent;
+ my $ua = new LWP::UserAgent('cookie_jar' => HTTP::Cookies->new);
my $res = $ua->request( GET( $url ) );
warn $res->as_string
if $DEBUG > 1;
- unless ($res->code eq '200') {
+ if (!$res->is_success) {
$error = $res->message;
@@ -67,7 +68,7 @@ sub get_censustract {
last if $viewstate && $eventvalidation;
}
- unless ($viewstate && $eventvalidation ) {
+ if (!$viewstate or !$eventvalidation ) {
$error = "either no __VIEWSTATE or __EVENTVALIDATION found";
@@ -79,6 +80,7 @@ sub get_censustract {
my @ffiec_args = (
__VIEWSTATE => $viewstate,
__EVENTVALIDATION => $eventvalidation,
+ __VIEWSTATEENCRYPTED => '',
ddlbYear => $year,
txtAddress => $location->{address1},
txtCity => $location->{city},