File tree Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 3
3
All notable changes to this project will be documented in this file. This project adheres to
4
4
[ Semantic Versioning] ( http://semver.org/ ) and [ this changelog format] ( http://keepachangelog.com/ ) .
5
5
6
+ ## [ 1.0.0] - 2021-07-31
7
+
8
+ ### Fixed
9
+
10
+ - Ensure the ` DataResponse ` class passes on its created flag if its data member is already a ` JsonApiResource ` .
11
+ - Only add the ` Location ` header to a response if the resource has a ` self ` URL. Previously the header would be set with
12
+ a ` null ` value.
13
+
6
14
## [ 1.0.0-beta.5] - 2021-07-10
7
15
8
16
### Added
Original file line number Diff line number Diff line change @@ -137,7 +137,9 @@ private function prepareDataResponse($request)
137
137
}
138
138
139
139
if ($ this ->value instanceof JsonApiResource) {
140
- return $ this ->value ->prepareResponse ($ request );
140
+ return $ this ->value
141
+ ->prepareResponse ($ request )
142
+ ->withCreated ($ this ->created );
141
143
}
142
144
143
145
$ resources = $ this ->server ()->resources ();
Original file line number Diff line number Diff line change @@ -131,8 +131,8 @@ protected function headers(): array
131
131
->merge ($ this ->headers ?: [])
132
132
->all ();
133
133
134
- if ($ this ->resourceWasCreated ()) {
135
- $ headers ['Location ' ] = $ this -> resource -> selfUrl () ;
134
+ if ($ this ->resourceWasCreated () && $ selfUrl = $ this -> resource -> selfUrl () ) {
135
+ $ headers ['Location ' ] = $ selfUrl ;
136
136
}
137
137
138
138
return $ headers ;
You can’t perform that action at this time.
0 commit comments