Skip to content

Explicitly fail if EXCLUDE_URL_PREFIXES is a string #249

@okkays

Description

@okkays

Context

After updating to 4.0b2, configuration values stored as tuple are silently ignored.

We use a security scanner (zap) which had started failing due to missing CSP headers. The docs mention that Many settings require a tuple or list. You may get very strange policies and even errors when mistakenly configuring them as a string.

After migrating to 4.0-compatible configuration, all of our values were tuple - changing them to list caused the header to appear again (this commit)

Suggestions

  • It'd be nice if incorrect configuration failed explicitly, rather than effectively skipping CSP. It's hard to notice the missing CSP header without a scanner, and it was difficult to debug why it wasn't being added. This was also how we noticed we needed to change our config for 4.0 - the security scanner caught it; our app ran without exception.
  • Re-support tuple or drop support for it from the documentation. All examples and tests appear to expect lists, anyway 🤷

This is low priority for us personally since we've figured it out and made the change, but I figured I'd bring this to your attention since it can silently disable CSP for config that conforms to the docs 😅

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions