« Previous | Next » 

Revision 258d6fbc

Parent aad91592
Child 036d30cb

Added by Bastian Waidelich over 6 years ago

[BUGFIX] Make ``resource://`` URIs work with 40 character Package Keys

The Flow ``ResourceStreamWrapper`` transparently handles resource URLs
in the formats ``resource://<SHA1>`` (referring to the SHA1 hash of a
Flow Resource) and ``resource://Package.Key/some/path`` (referring to
a local file path relative to the specified package's Resources

Currently the detection of a SHA1 hash is unreliably only checking for
the string length being 40 characters. If a Package Key happens to be
exactly 40 characters long, static resources can't be loaded.
This change fixes the issue by replacing the ``strlen`` check with a
simple regular expression lookup that only accepts valid SHA1 hashes.

Change-Id: Iaba5342115f604bb46426c2579dca7679872b968
Fixes: FLOW-250
Releases: master, 3.0, 2.3, 2.2, 2.1

  • added
  • modified
  • copied
  • renamed
  • deleted