Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace regular expressions for path templating #3503

Closed
glowcloud opened this issue May 8, 2024 · 1 comment · May be fixed by Jircs1/swagger-ui#3
Closed

Replace regular expressions for path templating #3503

glowcloud opened this issue May 8, 2024 · 1 comment · May be fixed by Jircs1/swagger-ui#3

Comments

@glowcloud
Copy link
Contributor

glowcloud commented May 8, 2024

Instead of using regular expressions to replace URL path variables, we should use:

https://github.com/char0n/openapi-path-templating?tab=readme-ov-file#resolution

It looks like this affects at least two places:

req.url = req.url.replace(new RegExp(`{${parameter.name}}`, 'g'), encodeURIComponent(value));

req.url = req.url.replace(new RegExp(`{${name}}`, 'g'), styledValue);

@glowcloud glowcloud self-assigned this May 8, 2024
char0n added a commit that referenced this issue May 8, 2024
Refs #3503

---------

Co-authored-by: Vladimir Gorej <vladimir.gorej@gmail.com>
@glowcloud
Copy link
Contributor Author

Addressed in #3504

swagger-bot pushed a commit that referenced this issue May 8, 2024
## [3.27.4](v3.27.3...v3.27.4) (2024-05-08)

### Bug Fixes

* **security:** replace regular expressions in path builders ([#3504](#3504)) ([642a87c](642a87c)), closes [#3503](#3503)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant