Skip to content

Commit

Permalink
Fix the response as expected by the test. (#57)
Browse files Browse the repository at this point in the history
Islandora\Crayfish\Commons\Tests\ApixMiddlewareTest::testReturns400IfNoApixLdpResourceHeader()
expects an HTTP 400 to be emitted; however, it was not so.
  • Loading branch information
adam-vessey authored Oct 19, 2022
1 parent e5babd9 commit 64f0c7c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ApixMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ public function before(RequestEvent $event)
if (!$request->headers->has("Apix-Ldp-Resource")) {
$this->log->debug("No Apix-Ldp-Resource header present, no fedora_resource set");
$request->attributes->set('fedora_resource', false);
$event->setResponse(new Response(
"Malformed request, no Apix-Ldp-Resource header present",
400
));
return;
}

Expand Down

0 comments on commit 64f0c7c

Please sign in to comment.