Skip to content
This repository has been archived by the owner on Jul 15, 2021. It is now read-only.

Special characters make the SubfolderNamingStrategy fail #5

Open
Tobion opened this issue Jan 15, 2018 · 3 comments
Open

Special characters make the SubfolderNamingStrategy fail #5

Tobion opened this issue Jan 15, 2018 · 3 comments

Comments

@Tobion
Copy link

Tobion commented Jan 15, 2018

When there are special characters in the URI path that are not allowed by the filesystem (like : on Windows), the MockStorageAdapter using SubfolderNamingStrategy fails with

Symfony\Component\Filesystem\Exception\IOException: Failed to create "/vagrant/tests/fixtures/guzzle/.../transform;key=rest:api": mkdir(): Input/output error.

And unfortunately one cannot reconfigure the adapters, making the caching / mocking unusable.

Tobion added a commit to Tobion/guzzle-cache-middleware that referenced this issue Jan 15, 2018
@csarrazi
Copy link
Owner

Good point. I think we should simply ignore reserved characters for all operating systems, when fetching the path information from the URI.

@Tobion
Copy link
Author

Tobion commented Mar 7, 2020

Btw, the https://github.com/csarrazi/guzzle-cache-middleware/blob/master/src/Adapter/MockStorageAdapter.php does not seem necessary. You could use the https://github.com/csarrazi/guzzle-cache-middleware/blob/master/src/Adapter/PsrAdapter.php also for the mock storage. In the https://github.com/csarrazi/CsaGuzzleBundle you could use the symfony filesystem cache adapter without ttl and the IdentityMarshaller (or a custom one for responses).

@Tobion
Copy link
Author

Tobion commented Mar 7, 2020

This way the library also wouldn't need to worry about such things like invalid chars. But the cache key would usually not translate to the filename as the key is likely hashed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants