Skip to content

Just one character to make regex a little bit faster #63

@maxp

Description

@maxp

Non greedy regex could be relatively slow in some cases
https://github.com/ring-clojure/ring-json/blob/master/src/ring/middleware/json.clj#L13

just add one '?' after first +

#"^application/(.+?\+)?json"

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