Skip to content

CORS IndexOutOfBoundsException when you pass an Origin without a . #2104

@Jerbell

Description

@Jerbell

Actual behavior (the bug)
I get a java.lang.IndexOutOfBoundsException: Index: 1, Size: 1 exception when using the CorsPlugin and pass in header https://exactxcom. This is due to CorsUtils originsMatch method line 139, - see the split: clientOrigin.host.split('.', limit = 2)[1]

Expected behavior
Need to allow for a client host without a full stop.

To Reproduce
Enable Cors plugin, pass in an origin header like https://single see the fireworks.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions