While attempting to use the REST_Controller, I have came across problems in accessing the HTTP headers of the request. Looking into the problem I have found that in the function head(), references to the header arguments were wrongly via head_args[], but should have been correctly via _head_args[].
Provided below is the patched code:
public function head($key = NULL, $xss_clean = NULL)
{
if ($key === NULL)
{
return $this->_head_args;
}
return isset($this->_head_args[$key]) ? $this->_xss_clean($this->_head_args[$key], $xss_clean) : NULL;
}