Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileStore: Long cache keys may result in too long paths due to encoding #19889

Merged
merged 1 commit into from Oct 20, 2015

Conversation

cedrics
Copy link

@cedrics cedrics commented Apr 24, 2015

Currently it is ensured that a cache key is not bigger than the max path length of the system before it is URI encoded. As URI encoding is adding additional chars, a long cache key containing some chars that get encoded may still result in too long paths. This lead to an exception in our application.

This PR changes this by checking the length after the cache key was encoded and using the hexdigested value of the cache key instead.
This solution will only change the cache keys for a small subset: All keys that are not longer than 900 chars but are longer than 900 when URI encoded.
#15688 tackles a similar problem and would also solve mine as far as I can tell.

sgrif added a commit that referenced this pull request Oct 20, 2015
FileStore: Long cache keys may result in too long paths due to encoding
@sgrif sgrif merged commit 2812917 into rails:master Oct 20, 2015
@cedrics cedrics deleted the long-uri-encoded-keys branch October 27, 2015 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants