« Previous | Next » 

Revision 32afbfde

ID32afbfde044869a5b20c02349db221c1206a614e
Parent 0e334778
Child fb0be1d7

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
directory).

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