SecureHeaders excessively deduplicates sources without taking schemes into account leading to removal of sources that shouldn't be removed.
I think the problem is with dedup_source_list() which relies on filesystem-like matching.
Expected Header
Content-Security-Policy: default-src 'self' wss://ws.contoso.com *.contoso.com
Actual Header
Content-Security-Policy: default-src 'self' *.contoso.com
Config
SecureHeaders::Configuration.defaultdo |config|
config.csp={preserve_schemes: true,# this line doesn't matter, actuallydefault_src: %w('self'wss://ws.contoso.com*.contoso.com)}end
SecureHeadersexcessively deduplicates sources without taking schemes into account leading to removal of sources that shouldn't be removed.I think the problem is with
dedup_source_list()which relies on filesystem-like matching.Expected Header
Content-Security-Policy: default-src 'self' wss://ws.contoso.com *.contoso.comActual Header
Content-Security-Policy: default-src 'self' *.contoso.comConfig