mirror of
https://github.com/ambieco/scribe.git
synced 2026-04-24 08:44:56 +08:00
[BUGFIXES] Header containing ":" + invalid "showresponse" condition (#242)
* [BUGFIX] Header containing ":" values management * [CHANGE] To pass styleci.io tests * [BUGFIX] Invalid condition test to display response
This commit is contained in:
committed by
Marcel Pociot
parent
fe58fa263b
commit
4a78f3db0f
@@ -112,9 +112,11 @@ abstract class AbstractGenerator
|
||||
|
||||
// Split headers into key - value pairs
|
||||
$headers = collect($headers)->map(function ($value) {
|
||||
$split = explode(':', $value);
|
||||
$split = explode(':', $value); // explode to get key + values
|
||||
$key = array_shift($split); // extract the key and keep the values in the array
|
||||
$value = implode(':', $split); // implode values into string again
|
||||
|
||||
return [trim($split[0]) => trim($split[1])];
|
||||
return [trim($key) => trim($value)];
|
||||
})->collapse()->toArray();
|
||||
|
||||
//Changes url with parameters like /users/{user} to /users/1
|
||||
|
||||
@@ -38,7 +38,7 @@ $.ajax(settings).done(function (response) {
|
||||
});
|
||||
```
|
||||
|
||||
@if(in_array('GET',$parsedRoute['methods']) || isset($parsedRoute['showresponse']) && $parsedRoute['showresponse'])
|
||||
@if(in_array('GET',$parsedRoute['methods']) || (isset($parsedRoute['showresponse']) && $parsedRoute['showresponse']))
|
||||
> Example response:
|
||||
|
||||
```json
|
||||
|
||||
Reference in New Issue
Block a user