Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Order of HTTP request headers

by kappa (Chaplain)
on Oct 14, 2008 at 14:52 UTC ( [id://717002]=perlquestion: print w/replies, xml ) Need Help??

kappa has asked for the wisdom of the Perl Monks concerning the following question:

Good day, fellow monks!

Is there a way to get the order of HTTP headers the client sent to us using mod_perl? It looks like HTTP headers always get to Perl level represented as hash.

--kap

Replies are listed 'Best First'.
Re: Order of HTTP request headers
by Fletch (Bishop) on Oct 14, 2008 at 15:42 UTC

    One wonders, erm, why? The order is neither specified nor significant (apart from a general recommended ordering of header types), so why do you think it's of any use?

    (Having said that, $r->headers_in returns an APR::Table instance rather than a true hash, and that class supports a method $tbl->do( $callback ) which iterates over the items in the table passing key/value paris to the callback (presumably in order as the APR::Table docs specifies keys are stored in the order added). That might get what you're looking for.)

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.

      We're trying to use the order of HTTP request headers as a factor in our antifraud system. We found out that our beloved bots send the headers in a distinctly different order than all current browsers.

      Thanks for the advice! Too bad our main system uses Apache 1.3 but we'll probably use the APR::Table in another place.

      --kap

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://717002]
Approved by Narveson
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-19 02:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found