Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/489'
Browse files Browse the repository at this point in the history
Close #489
  • Loading branch information
weierophinney committed Oct 9, 2017
2 parents 852d228 + 5728778 commit 0630c64
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Expand Up @@ -2,7 +2,7 @@

All notable changes to this project will be documented in this file, in reverse chronological order by release.

## 2.0.4 - TBD
## 2.0.4 - 2017-10-09

### Added

Expand All @@ -25,6 +25,10 @@ All notable changes to this project will be documented in this file, in reverse
and 2.
- [#482](https://github.com/zendframework/zend-expressive/pull/482) fixes the
`Application::$defaultDelegate` dockblock Type.
- [#489](https://github.com/zendframework/zend-expressive/pull/489) fixes an
edge case in the `WhoopsErrorHandler` whereby it would emit an error if
`$_SERVER['SCRIPT_NAME']` did not exist. It now checks for that value before
attempting to use it.

## 2.0.3 - 2017-03-28

Expand Down
5 changes: 4 additions & 1 deletion src/Middleware/WhoopsErrorResponseGenerator.php
Expand Up @@ -92,10 +92,13 @@ private function prepareWhoopsHandler(ServerRequestInterface $request, PrettyPag
$uri = $request->getAttribute('originalUri', false) ?: $request->getUri();
$request = $request->getAttribute('originalRequest', false) ?: $request;

$serverParams = $request->getServerParams();
$scriptName = isset($serverParams['SCRIPT_NAME']) ? $serverParams['SCRIPT_NAME'] : '';

$handler->addDataTable('Expressive Application Request', [
'HTTP Method' => $request->getMethod(),
'URI' => (string) $uri,
'Script' => $request->getServerParams()['SCRIPT_NAME'],
'Script' => $scriptName,
'Headers' => $request->getHeaders(),
'Cookies' => $request->getCookieParams(),
'Attributes' => $request->getAttributes(),
Expand Down

0 comments on commit 0630c64

Please sign in to comment.