Skip to content

Commit

Permalink
Correct Headers returned on Collection creation
Browse files Browse the repository at this point in the history
  • Loading branch information
whikloj committed Mar 24, 2016
1 parent 9945b2e commit 3b98597
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public function __construct(Application $app, IUuidGenerator $uuidGenerator) {

public function create(Application $app, Request $request, $id) {
$tx = $request->query->get('tx', "");

//Check for format
$format = NULL;
try {
Expand Down Expand Up @@ -98,8 +97,9 @@ public function create(Application $app, Request $request, $id) {
$putHeaders = $responsePut->getHeaders();
//Guzzle psr7 response objects are inmutable. So we have to make this an array and add directly
$putHeaders['Link'] = array('<'.$responsePut->getBody().'>; rel="alternate"');
$putHeaders['Link'] = array('<'.$urlRoute.$fakeUuid.'/members>; rel="hub"');
$putHeaders['Location'] = array($urlRoute.$fakeUuid);
$return_uuid = (isset($existingUuid) ? $existingUuid : $newUuid);
$putHeaders['Link'] = array('<'.$urlRoute.$return_uuid.'/members>; rel="hub"');
$putHeaders['Location'] = array($urlRoute.$return_uuid);
//Should i care about the etag?
return new Response($putHeaders['Location'][0], 201, $putHeaders);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ public function connect(Application $app) {
//
// Define routing referring to controller services
//
$CollectionControllers->before($app['islandora.hostHeaderNormalize']);

$CollectionControllers->post("/collection/{id}", "islandora.collectioncontroller:create")
->value('id',"")
Expand Down

0 comments on commit 3b98597

Please sign in to comment.