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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(recorder): escape single quotes in path of default output #2137

Merged
merged 1 commit into from
Jan 30, 2021

Conversation

mastermatt
Copy link
Member

Because the default output of the recorder uses single quotes, any such
quotes in the path would generate invalid Javascript.

I would prefer to use backticks, but went with escaping the single quote as the former would create a lot of unnecessary diffs for consumers commiting the output to version control (馃槈 @koerbcm).

Fixes: #2136

Because the default output of the recorder uses single quotes, any such
quotes in the path would generate invalid Javascript.
@mastermatt mastermatt requested a review from a team January 30, 2021 02:29
@@ -13,6 +13,8 @@ const servers = require('./servers')

require('./setup')

// TODO: the guts of this file should be wrapped in a `describe`.
// These before and afters run for every test in the repo under Mocha.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

馃槷

@paulmelnikow
Copy link
Member

Thanks Matt.

@mastermatt mastermatt merged commit 0f7b52e into nock:main Jan 30, 2021
@mastermatt mastermatt deleted the 2136-escape-quote-in-recorded-path branch January 30, 2021 03:12
@github-actions
Copy link

馃帀 This PR is included in version 13.0.7 馃帀

The release is available on:

Your semantic-release bot 馃摝馃殌

uxmaster added a commit to uxmaster/nock that referenced this pull request Feb 1, 2021
fix(recorder): escape single quotes in path of default output (nock#2137)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid generated fixture if single quotes are present in the request URL path
2 participants