Skip to content
This repository was archived by the owner on Mar 20, 2024. It is now read-only.
This repository was archived by the owner on Mar 20, 2024. It is now read-only.

Faulty logic in param matching for getRouteRegExp #69

Open
@joacimastrom

Description

@joacimastrom

The matching of params when creating the regex is breaking since params extracted from the route will have format [":param1", ":param2"] while the ones added wont have the : since they are likely used as:

getCacheConfRegExp(cacheConf, {
  param1,
  param2,
});

Even if you explicitly name the params

getCacheConfRegExp(cacheConf, {
  ":param1": param1,
  ":param2": param2,
});

the pattern-replace will fail in the loop a few lines down since it then tries to match ::param1 which doesn't exist in the route

pattern = pattern.replace(`:${paramName}`, params[paramName]);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions