|
10 | 10 | use DreamFactory\Core\Events\PostProcessApiEvent; |
11 | 11 | use DreamFactory\Core\Events\PreProcessApiEvent; |
12 | 12 | use DreamFactory\Core\Events\ServiceEvent; |
13 | | -use DreamFactory\Core\Resources\System\Cache; |
14 | 13 | use DreamFactory\Core\Script\Components\ScriptHandler; |
15 | 14 | use DreamFactory\Core\Script\Events\BaseEventScriptEvent; |
16 | 15 | use DreamFactory\Core\Script\Events\EventScriptDeletedEvent; |
17 | 16 | use DreamFactory\Core\Script\Events\EventScriptModifiedEvent; |
18 | 17 | use DreamFactory\Core\Script\Jobs\ServiceEventScriptJob; |
19 | 18 | use DreamFactory\Core\Script\Models\EventScript; |
| 19 | +use DreamFactory\Core\System\Resources\Cache; |
20 | 20 | use DreamFactory\Core\Utility\ResponseFactory; |
21 | 21 | use Illuminate\Contracts\Events\Dispatcher; |
22 | 22 | use Illuminate\Foundation\Bus\DispatchesJobs; |
@@ -83,8 +83,9 @@ public function handleApiEvent($event) |
83 | 83 | $content = array_get($response, 'content'); |
84 | 84 | $contentType = array_get($response, 'content_type'); |
85 | 85 | $status = array_get($response, 'status_code', HttpStatusCodeInterface::HTTP_OK); |
| 86 | + $headers = (array)array_get($response, 'headers'); |
86 | 87 |
|
87 | | - $event->response = ResponseFactory::create($content, $contentType, $status); |
| 88 | + $event->response = ResponseFactory::create($content, $contentType, $status, $headers); |
88 | 89 | } else { |
89 | 90 | // otherwise assume raw content |
90 | 91 | $event->response = ResponseFactory::create($response); |
|
0 commit comments