Author: sevein
Date: Sat Oct 8 12:59:29 2011
New Revision: 9989
Log:
Return status code 415 if media type is not supported, add Content-Type
Modified:
trunk/plugins/qtSwordPlugin/modules/qtSwordPlugin/actions/depositAction.class.php
Modified:
trunk/plugins/qtSwordPlugin/modules/qtSwordPlugin/actions/depositAction.class.php
==============================================================================
---
trunk/plugins/qtSwordPlugin/modules/qtSwordPlugin/actions/depositAction.class.php
Sat Oct 8 12:57:52 2011 (r9988)
+++
trunk/plugins/qtSwordPlugin/modules/qtSwordPlugin/actions/depositAction.class.php
Sat Oct 8 12:59:29 2011 (r9989)
@@ -21,24 +21,26 @@
{
public function execute($request)
{
-
$this->resource = $this->getRoute()->resource;
if ($request->isMethod('post'))
{
if (!in_array($request->getHttpHeader('X-Packaging'),
qtSwordPluginConfiguration::$packaging))
{
- $this->response->setStatusCode('405');
+ // HTTP status code 415: Unsupported Media Type
+ $this->response->setStatusCode('415');
+
+ $request->setRequestFormat('xml');
}
- }
- // 201 Created
- $this->response->setStatusCode('201');
+ // HTTP status code 201: Created
+ $this->response->setStatusCode('201');
- // Location
- // $this->response->setHttpHeader('Location', '...');
+ // Location
+ // $this->response->setHttpHeader('Location', '...');
+ }
- // Optional Atom Entry document
+ $this->response->setHttpHeader('Content-Type', 'application/atom+xml;
charset="utf-8"');
$request->setRequestFormat('xml');
}
--
You received this message because you are subscribed to the Google Groups
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/qubit-commits?hl=en.