mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-27 22:33:10 +09:00
Add RawDisplayHandler and fix RSS/Atom not producing the correct headers
This commit is contained in:
parent
35203b684d
commit
a405b91e42
5 changed files with 49 additions and 4 deletions
|
|
@ -1021,10 +1021,14 @@ class Context
|
|||
* @param string $method Response method. [HTML|XMLRPC|JSON]
|
||||
* @return void
|
||||
*/
|
||||
public static function setResponseMethod($method = 'HTML')
|
||||
public static function setResponseMethod($method = 'HTML', $content_type = null)
|
||||
{
|
||||
$methods = array('HTML' => 1, 'XMLRPC' => 1, 'JSON' => 1, 'JS_CALLBACK' => 1);
|
||||
$methods = array('HTML' => 1, 'XMLRPC' => 1, 'JSON' => 1, 'JS_CALLBACK' => 1, 'RAW' => 1);
|
||||
self::$_instance->response_method = isset($methods[$method]) ? $method : 'HTML';
|
||||
if ($content_type)
|
||||
{
|
||||
self::$_instance->response_content_type = $content_type;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1040,7 +1044,7 @@ class Context
|
|||
}
|
||||
|
||||
$method = self::getRequestMethod();
|
||||
$methods = array('HTML' => 1, 'XMLRPC' => 1, 'JSON' => 1, 'JS_CALLBACK' => 1);
|
||||
$methods = array('HTML' => 1, 'XMLRPC' => 1, 'JSON' => 1, 'JS_CALLBACK' => 1, 'RAW' => 1);
|
||||
|
||||
return isset($methods[$method]) ? $method : 'HTML';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue