Skip to content
This repository has been archived by the owner on Feb 5, 2019. It is now read-only.

Commit

Permalink
Merge pull request #16 from CodeIncHQ/2.x
Browse files Browse the repository at this point in the history
2.x
  • Loading branch information
Joan Fabrégat authored Oct 8, 2018
2 parents 14b5b52 + e8b0d4c commit 64778f9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 2 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codeinc/assets-middleware",
"version": "2.0.4",
"version": "2.0.5",
"description": "A PSR-15 middleware to server static assets (CSS, JS, images, etc.)",
"homepage": "https://github.com/CodeIncHQ/AssetsMiddleware",
"type": "library",
Expand All @@ -15,8 +15,7 @@
"codeinc/psr7-responses": "^2",
"matthiasmullie/minify": "^1.3",
"codeinc/media-types": "^1.0",
"enshrined/svg-sanitize": "^0.8.2",
"ramsey/uuid": "^3.8"
"enshrined/svg-sanitize": "^0.8.2"
},
"require-dev": {
"phpunit/phpunit": "^7",
Expand Down
3 changes: 1 addition & 2 deletions src/AssetsMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface;
use Ramsey\Uuid\Uuid;


/**
Expand Down Expand Up @@ -111,7 +110,7 @@ public function addAssetsDirectory(string $directoryPath, string $directoryKey =
if ($directoryKey !== null && empty($directoryKey)) {
throw new EmptyDirectoryKeyException($directoryPath);
}
$this->assetsDirectories[$directoryKey ?? Uuid::uuid4()->toString()] = $directoryPath;
$this->assetsDirectories[$directoryKey ?? hash('sha1', $directoryPath)] = $directoryPath;
}

/**
Expand Down

0 comments on commit 64778f9

Please sign in to comment.