Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Trouble getting http header value into new CGI environment variable

623672Nov 15 2008 — edited Nov 16 2008
Hello; not sure if this is the right category - I'm trying to get a value from the incoming http request header into a CGI environment variable that I've created, and no matter what I do I can't see any value by calling OWA_UTIL.GET_CGI_ENV('HTTP_X_FORWARDED_FOR'). All the posts I've found refer to just adding it to the DAD, but that doesn't apply here, since I'm using XE with Oracle Embedded PL/SQL Gateway/10.2.0.1.0. So I executed the following as SYS, connected as SYSDBA:

DBMS_EPG.SET_DAD_ATTRIBUTE ( dad_name => 'APEX', attr_name => 'cgi-environment-list', attr_value => 'HTTP_X_FORWARDED_FOR');

I've used Wireshark to analyze my own requests, and I DO see the headers I expect that match up to the existing CGI environment variables (i.e. "User-Agent" becomes "HTTP_USER_AGENT", "Accept-Charset" becomes "HTTP_ACCEPT_CHARSET", etc.) When I call OWA_UTIL.PRINT_CGI_ENV all these "existing" ones have the value matching the raw packets I see, but HTTP_X_FORWARDED_FOR is always empty, even though I know it has a value in the incoming HTTP request by looking at the raw traffic.

The thing that struck me as odd is that when I call OWA_UTIL.PRINT_CGI_ENV I do see HTTP_X_FORWARDED_FOR in the list of valid CGI environment variables, however when I access the listing through Application Express > Home > Administration > About Database I don't see it in the "CGI Environment" list (which I figure is why I can never get a value...) I love building with Oracle, but am not expert enough to know when I'm trying to do something that's just plain outside the scope of the free edition - this seems like other people have had success here though. Can anyone give me hints about what I'm doing wrong? The next place I'm heading is to look closer at the DBMS_EPG.AUTHORIZE_DAD procedure; maybe I'm doing it right but just haven't given the proper authorization to set that new variable?

Thanks so much;
-l
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 14 2008
Added on Nov 15 2008
1 comment
749 views