Skip to content

Conversation

jumoel
Copy link

@jumoel jumoel commented Apr 22, 2024

Overview

Fix a bug where a document whose name included _local somewhere would not get properly URL encoded.

Non-replicating documents need to start with _local and not just contain _local. The regular expression testing for this was missing a parenthesis.

Testing recommendations

This will allow documents that have a name both containing characters that need to be URL encoded as well as _local to be properly inserted.

GitHub issue number

Related Pull Requests

Checklist

  • Code is written and works correctly;
  • Changes are covered by tests;
  • Documentation reflects the changes;

req.uri += '/' + opts.path
} else if (opts.doc) {
if (!/^_design|_local/.test(opts.doc)) {
if (!/^(_design|_local)/.test(opts.doc)) {

Choose a reason for hiding this comment

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

Should we test for a slash immediately following _design or _local as well?

Suggested change
if (!/^(_design|_local)/.test(opts.doc)) {
if (!/^(_design|_local)\//.test(opts.doc)) {

@jumoel jumoel closed this Jun 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants