Okay....I posted here yesterday about some SSL problems I was having and got some very helpful responses

Got another one

I've got a form that is an Oracle Reports request that now posts to reports.pl

reports.pl determines whether or not the request is valid, and then points to one of two places

essentially:
if (invalid)
{ burp; }
else
{ print report; }

the 'print report;' statement is a very straightforward
my $req = HTTP::Request->new(GET => $good_url); if ($rep_format eq 'HTML') { $req->header('Accept' => 'text/html');} if ($rep_format eq 'PDF') { $req->header('Accept' => 'application/pdf');} if ($rep_format eq 'DELIMITED') { $req->header('Accept' => 'text/plain');} # send request my $res = $ua->request($req); if ($res->is_success) { print "Content-type: ".$res->header('Content-type')."\n\n".$res-> +content; } else { print "Error: " . $res->status_line . "\n"; }


The catch: this is all on a secure server (I work in healthcare - security is high on priority totem-pole)

When I manually print the content-type headers, the user gets a "This page includes both secure and non-secure items..." - doesn't matter if they pick yes or no, the PDF comes up just fine

When I don't manually print the content-type headers, I get a 500, and the error log says that the content-type headers are invalid - basically, the first line of the PDF (%PDF-1.1) isn't a recognized content-type

printing the content-type headers or not doesn't affect the HTML version of the report at all - it comes up just fine with no warning

How should I include the content type headers so that it'll bring up the PDF without warning the user (and, incidentally, giving them the opportunity to violate the security of their web session)? Everything else is working perfectly, this is the last step/barrier...

In reply to perl, Oracle, reports, and LWP by jdvernon1976

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.