Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@domdorn
Copy link
Member

@domdorn domdorn commented Sep 8, 2016

If using external tools to generate the digest of an asset (e.g. md5sum main.css > main.css.md5), it may happen that the tool adds non printable characters (like \n) after the digest.

This results in URLs generated like:
/assets/styles/dc5672cb5071cd31a6fb6d670807161c
-main.css

instead of
/assets/styles/dc5672cb5071cd31a6fb6d670807161c-main.css

Proposed solution: Trim the digest read from the digest file.

If using external tools to generate the digest of an asset (e.g. md5sum main.css > main.css.md5), it may happen that the tool adds non printable characters (like \n) after the digest.

This results in URLs generated like:
/assets/styles/dc5672cb5071cd31a6fb6d670807161c
-main.css

instead of 
/assets/styles/dc5672cb5071cd31a6fb6d670807161c-main.css

Proposed solution: Trim the digest read from the digest file.
@gmethvin gmethvin merged commit 0ac9a86 into playframework:master Sep 9, 2016
@gmethvin
Copy link
Member

gmethvin commented Sep 9, 2016

Seems reasonable. I think I've run into this issue before actually. I don't think there's a good reason for a digest to have spaces so I don't see a downside.

@mkurz
Copy link
Member

mkurz commented Sep 12, 2016

Should we backport this?

gmethvin pushed a commit that referenced this pull request Sep 14, 2016
If using external tools to generate the digest of an asset (e.g. md5sum main.css > main.css.md5), it may happen that the tool adds non printable characters (like \n) after the digest.

This results in URLs generated like:
/assets/styles/dc5672cb5071cd31a6fb6d670807161c
-main.css

instead of
/assets/styles/dc5672cb5071cd31a6fb6d670807161c-main.css

Proposed solution: Trim the digest read from the digest file.
@gmethvin
Copy link
Member

backported to 2.5.x: d2c4cad

@mkurz mkurz added this to the 2.5.8 milestone Sep 14, 2016
wsargent pushed a commit to wsargent/playframework that referenced this pull request Oct 25, 2016
…framework#6539)

If using external tools to generate the digest of an asset (e.g. md5sum main.css > main.css.md5), it may happen that the tool adds non printable characters (like \n) after the digest.

This results in URLs generated like:
/assets/styles/dc5672cb5071cd31a6fb6d670807161c
-main.css

instead of 
/assets/styles/dc5672cb5071cd31a6fb6d670807161c-main.css

Proposed solution: Trim the digest read from the digest file.
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.

3 participants