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 access log field parsing #4113

Merged
merged 2 commits into from Oct 29, 2018

Conversation

Ullaakut
Copy link
Contributor

What does this PR do?

This PR fixes #3841 and adds a unit test to cover the specific case that was causing it.

Basically, when using a YAML file to pass arguments, they are passed with escaped backquotes if backquotes are present in the input YAML file.

For example:

args:
        - --accessLog.fields.names="Username=drop Hostname=drop ClientUsername=drop ClientHost=drop"

Would be received by the flaeg parser as "Username=drop Hostname=drop ClientUsername=drop ClientHost=drop". The parser then used to break it down into key value pairs and store it in a map. What happened was that for the last key (here ClientHost in this example, the value had a backquote at the end of it (drop" in this case), which didn't match with either drop, keep or redact. It was then replaced by the default value.

Removing the backquotes in the YAML file was a workaround for this, but it definitely isn't intuitive, so a fix was needed in the parser itself to handle that case.

No documentation change should be needed.

Motivation

Fixing #3841

More

  • Added/updated tests
  • Added/updated documentation

Copy link
Member

@ldez ldez 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

@mmatur mmatur 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

@juliens juliens left a comment

Choose a reason for hiding this comment

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

LGTM

@traefiker traefiker force-pushed the GH-3841-fix-access-log-field-parsing branch from 47ddbf7 to fba516f Compare October 29, 2018 15:06
@traefiker traefiker merged commit 993caf5 into traefik:v1.7 Oct 29, 2018
@Ullaakut Ullaakut deleted the GH-3841-fix-access-log-field-parsing branch January 26, 2021 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants