This repository was archived by the owner on Nov 24, 2025. It is now read-only.
Prevent Perl input record separator change in TO dbdump API#2977
Merged
Conversation
Contributor
|
Refer to this link for build results (access rights to CI server needed): |
Due to the way this code was previously written, the first call to the
dbdump API is successful, but subsequent calls are broken because the
chomp() function no longer strips trailing whitespace from the output of
the `hostname` command. This ends up breaking the response headers
because of the unexpected newline, causing traffic_ops_golang to emit
this error and return a 502:
http: proxy error: net/http: HTTP/1.x transport connection broken:
malformed MIME header line: -20181031125221.pg_dump"
By only locally declaring $/ (undefined), subsequent calls to `chomp()`
actually strip newlines because `$/ == "\n"` by default.
eb451b1 to
419fcf9
Compare
Contributor
|
Refer to this link for build results (access rights to CI server needed): |
dangogh
approved these changes
Nov 5, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Due to the way this code was previously written, the first call to the
dbdump API is successful, but subsequent calls are broken because the
chomp() function no longer strips trailing whitespace from the output of
the
hostnamecommand. This ends up breaking the response headersbecause of the unexpected newline, causing traffic_ops_golang to emit
this error and return a 502:
By only locally declaring $/ (undefined) in the
doblock, subsequentcalls to
chomp()actually strip newlines because$/ == "\n"bydefault.
Which TC components are affected by this PR?
What is the best way to verify this PR?
Check all that apply