J
JD Vernon
I'm working on a Perl gatekeeper for report requests on an Oracle web
app
Essentially, the code is:
if (invalid request)
{ burp; }
else
{ print report; }
print report is the last thing not quite working - everything else is
great
here's the problem - if the user requests a PDF version of the report,
if I print "Content-type: application/pdf" before printing the URL,
they get a popup that says "This page contains both secure and
non-secure objects...blahblahblah" and it doesn't matter if they
select Yes or No, the report comes up just fine
if I don't include the headers, a 500 Internal Server Error results,
because it tries to grab the content-type headers from the PDF and it
doesn't know what to do with "%PDF-1.1"
include the headers or not, if the user selects the HTML version of
the report, no errors and the report comes up fine
i don't know if it's *what* I'm printing or *that* I'm printing, but
any direction/insight anyone can provide is greatly appreciated
i've included the "print report;" code below
Thanks
JDV
use LWP::UserAgent;
use HTTP::Headers;
$good_url = "https:".$server."ows-bin/rwcgi60.exe?".$in;
my $req = HTTP::Request->new(GET => $good_url);
if ($rep_format eq 'HTML')
{ $req->header('Content-type' => 'text/html');}
if ($rep_format eq 'PDF')
{ $req->header('Content-type' => 'application/pdf');}
if ($rep_format eq 'DELIMITED')
{ $req->header('Content-type' => 'text/plain');}
my $res = $ua->request($req);
$res->header('Content-type' => $req->header('Content-type'));
if ($res->is_success)
{
print 'Content-type: '.$res->header('Content-type');
print "\n\n";
print $res->content;
}
else
{ print "Error: " . $res->status_line . "\n"; }
--
PLEASE NOTE: comp.infosystems.www.authoring.cgi is a
SELF-MODERATED newsgroup. aa.net and boutell.com are
NOT the originators of the articles and are NOT responsible
for their content.
HOW TO POST to comp.infosystems.www.authoring.cgi:
http://www.thinkspot.net/ciwac/howtopost.html
app
Essentially, the code is:
if (invalid request)
{ burp; }
else
{ print report; }
print report is the last thing not quite working - everything else is
great
here's the problem - if the user requests a PDF version of the report,
if I print "Content-type: application/pdf" before printing the URL,
they get a popup that says "This page contains both secure and
non-secure objects...blahblahblah" and it doesn't matter if they
select Yes or No, the report comes up just fine
if I don't include the headers, a 500 Internal Server Error results,
because it tries to grab the content-type headers from the PDF and it
doesn't know what to do with "%PDF-1.1"
include the headers or not, if the user selects the HTML version of
the report, no errors and the report comes up fine
i don't know if it's *what* I'm printing or *that* I'm printing, but
any direction/insight anyone can provide is greatly appreciated
i've included the "print report;" code below
Thanks
JDV
use LWP::UserAgent;
use HTTP::Headers;
$good_url = "https:".$server."ows-bin/rwcgi60.exe?".$in;
my $req = HTTP::Request->new(GET => $good_url);
if ($rep_format eq 'HTML')
{ $req->header('Content-type' => 'text/html');}
if ($rep_format eq 'PDF')
{ $req->header('Content-type' => 'application/pdf');}
if ($rep_format eq 'DELIMITED')
{ $req->header('Content-type' => 'text/plain');}
my $res = $ua->request($req);
$res->header('Content-type' => $req->header('Content-type'));
if ($res->is_success)
{
print 'Content-type: '.$res->header('Content-type');
print "\n\n";
print $res->content;
}
else
{ print "Error: " . $res->status_line . "\n"; }
--
PLEASE NOTE: comp.infosystems.www.authoring.cgi is a
SELF-MODERATED newsgroup. aa.net and boutell.com are
NOT the originators of the articles and are NOT responsible
for their content.
HOW TO POST to comp.infosystems.www.authoring.cgi:
http://www.thinkspot.net/ciwac/howtopost.html