Skip to content

Commit

Permalink
Allow "ucwords" header (#103)
Browse files Browse the repository at this point in the history
* allow "ucwords" header
  • Loading branch information
koriym committed May 20, 2017
1 parent 6e4d6e4 commit 5c4b058
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/OptionsRenderer.php
Expand Up @@ -44,7 +44,7 @@ public function render(ResourceObject $ro)
{
$ro->headers['Content-Type'] = 'application/json';
$allows = $this->getAllows((new \ReflectionClass($ro))->getMethods());
$ro->headers['allow'] = implode(', ', $allows);
$ro->headers['Allow'] = implode(', ', $allows);
$body = $this->getEntityBody($ro, $allows);
$ro->view = json_encode($body, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . PHP_EOL;

Expand Down
2 changes: 1 addition & 1 deletion tests-php7/OptionsTest.php
Expand Up @@ -37,7 +37,7 @@ public function testOptionsMethod()
{
$request = new Request($this->invoker, new DocPhp7, Request::OPTIONS);
$response = $this->invoker->invoke($request);
$actual = $response->headers['allow'];
$actual = $response->headers['Allow'];
$expected = 'GET';
$this->assertSame($actual, $expected);

Expand Down
6 changes: 3 additions & 3 deletions tests/InvokerTest.php
Expand Up @@ -94,7 +94,7 @@ public function testOptionsMethod()
{
$request = new Request($this->invoker, new Doc, Request::OPTIONS);
$response = $this->invoker->invoke($request);
$actual = $response->headers['allow'];
$actual = $response->headers['Allow'];
$expected = 'GET, POST, DELETE';
$this->assertSame($actual, $expected);

Expand Down Expand Up @@ -152,7 +152,7 @@ public function testOptionsMethod2()
{
$request = new Request($this->invoker, new Order, Request::OPTIONS);
$response = $this->invoker->invoke($request);
$actual = $response->headers['allow'];
$actual = $response->headers['Allow'];
$expected = 'GET, POST';
$this->assertSame($actual, $expected);
}
Expand All @@ -162,7 +162,7 @@ public function testOptionsWeaver()
$order = (new Compiler($_ENV['TMP_DIR']))->newInstance(Order::class, [], new Bind);
$request = new Request($this->invoker, $order, Request::OPTIONS);
$response = $this->invoker->invoke($request);
$actual = $response->headers['allow'];
$actual = $response->headers['Allow'];
$expected = 'GET, POST';
$this->assertSame($actual, $expected);
}
Expand Down

0 comments on commit 5c4b058

Please sign in to comment.