Christopher Stanton wrote: > 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 > http://perl.apache.org/docs/2.0/api/Apache2/RequestRec.html#C_allowed_ > 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)); > and > $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: > 1 > 2 > > 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?
the Allow header appears to be built not from r->allowed but r->allowed_methods->method_mask. so, try this: http://perl.apache.org/docs/2.0/api/Apache2/Access.html#C_allow_methods_ HTH --Geoff