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

fix dynamic config #1228

Merged
merged 2 commits into from
Jun 25, 2024
Merged

Conversation

labuladong
Copy link
Contributor

@labuladong labuladong commented Jun 25, 2024

If users use a custom dynamic configuration, it's better not to do any escaping for the config value. Let the user fill it out manually.

The original implementation will escape the value twice, the first time is here:

value := url.QueryEscape(configValue)

the second time is here:

for i, part := range parts {
escapedParts[i] = url.PathEscape(part)
}

@@ -112,3 +112,8 @@ func (c *pulsarClient) endpoint(componentPath string, parts ...string) string {
path.Join(escapedParts...),
)
}

// this function won't do any escaping
func (c *pulsarClient) endpointWithFullPath(componentPath string, fullPath string) string {
Copy link
Member

Choose a reason for hiding this comment

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

Can we add some tests to cover this fix?

Copy link
Member

@crossoverJie crossoverJie left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@Demogorgon314 Demogorgon314 left a comment

Choose a reason for hiding this comment

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

Good catch!

@Demogorgon314 Demogorgon314 merged commit a6e28dc into apache:master Jun 25, 2024
8 checks passed
@RobertIndie RobertIndie added this to the v0.13.0 milestone Jun 27, 2024
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.

4 participants