Skip to content

Commit

Permalink
Patch invalidate method
Browse files Browse the repository at this point in the history
  • Loading branch information
ScreamZ committed Dec 22, 2015
1 parent 1b8b4b3 commit 6d540bb
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions Services/SecureDownloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,22 @@ public function generateHash($filePath, $accessKey, $documentHashTTL = null)
/**
* Mark the download request as stale, another call using this hash will make the request miss.
*
* @param DownloadRequest $downloadRequest
* @param string $documentHash
* @param string $accessKey
*
* @return bool
* @throws DownloadRequestException
*/
public function invalidate(DownloadRequest $downloadRequest)
public function invalidate($documentHash, $accessKey)
{
$downloadRequest = $this->stash->getItem($this->stashPrefixKey.'/'.$downloadRequest->getHash());
$downloadRequest = $this->initiateDownloadRequest($documentHash, $accessKey);
if ($downloadRequest->isProcessable()) {
$downloadRequest = $this->stash->getItem($this->stashPrefixKey.'/'.$downloadRequest->getHash());

return $downloadRequest->clear();
return $downloadRequest->clear();
} else {
throw new DownloadRequestException($downloadRequest);
}
}

/**
Expand Down

0 comments on commit 6d540bb

Please sign in to comment.