@@ 260-262 (lines=3) @@ | ||
257 | ); |
|
258 | ||
259 | $documentVersion = $this->remoteStorage->getVersion($path); |
|
260 | if (null !== $ifMatch && !in_array($documentVersion, $ifMatch)) { |
|
261 | throw new HttpException('version mismatch', 412); |
|
262 | } |
|
263 | ||
264 | if (null !== $ifNoneMatch && in_array('*', $ifNoneMatch) && null !== $documentVersion) { |
|
265 | throw new HttpException('document already exists', 412); |
|
@@ 305-307 (lines=3) @@ | ||
302 | ||
303 | // if document does not exist, and we have If-Match header set we should |
|
304 | // return a 412 instead of a 404 |
|
305 | if (null !== $ifMatch && !in_array($documentVersion, $ifMatch)) { |
|
306 | throw new HttpException('version mismatch', 412); |
|
307 | } |
|
308 | ||
309 | if (null === $documentVersion) { |
|
310 | throw new HttpException( |
|
@@ 319-321 (lines=3) @@ | ||
316 | $ifMatch = $this->stripQuotes( |
|
317 | $request->getHeader('HTTP_IF_MATCH', false, null) |
|
318 | ); |
|
319 | if (null !== $ifMatch && !in_array($documentVersion, $ifMatch)) { |
|
320 | throw new HttpException('version mismatch', 412); |
|
321 | } |
|
322 | ||
323 | $x = $this->remoteStorage->deleteDocument( |
|
324 | $path, |