Skip to content
This repository was archived by the owner on Nov 22, 2018. It is now read-only.
This repository was archived by the owner on Nov 22, 2018. It is now read-only.

Allow a more flexible AllowOrigin response #89

Closed
@mharthoorn

Description

@mharthoorn

Instead of the CorsService peeking into the CorsPolicy

   policy.Origins.Contains(origin)

A method OriginAllowed(string origin) would allow for a much more flexible lookup policy. The service would then call:

  policy.OriginAllowed(origin)

This allows the policy to respond with a more ad hoc response like a (database) lookup.
The default would simply be:

        public virtual bool OriginAllowed(string origin)
        {
            return this.Origins.Contains(origin);
        }

But an override policy could become something like:

        public override bool OriginAllowed(string origin)
        {
            return repository.Exists<Sites>(s => s.Origin == origin);
        }

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