Re: mod_perl Apache2 RequestRec allowed problem
Christopher Stanton wrote:[color=blue]
> I am trying to set the allowed bitmask in a custom request handler
> when I receive the OPTIONS method (and when I receive a method request
> for a method I do not support).
> I have followed the example in
> but Apache always returns "Allow: GET,HEAD,POST,OPTIONS,TRACE" in the
> header irrespective of what options I set.
> For example, lets say I only accept PUT to try to restrict the
> available options to OPTIONS, TRACE, and PUT.
> I have tried both
> $r->allowed($r->allowed | (1<< Apache2::Const::M_PUT));
> with a return of Apache2::Const::DECLINED in either case in my handler.
> Neither ends up modifying the supported options sent to the client.
> In tha handler if I print the return value of $r->allowed:
> print $r->allowed(1<<Apache2::Const::M_PUT) . "\n";
> print $r->allowed() . "\n";
> return Apache2::Const::DECLINED;
> I get:
> So the record is being updated, but for some reason Apache is not
> basing its response to the client off of the record.
> Can anyone provide any insight into why I am unable to modify the list
> of request methods my handler is capable of servicing?[/color]
the Allow header appears to be built not from r->allowed but
r->allowed_methods->method_mask. so, try this: