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

Make it more difficult to accidentally log sensitive headers #6551

Merged
merged 1 commit into from Feb 8, 2021

Conversation

swankjesse
Copy link
Member

No description provided.

@@ -249,6 +249,14 @@ fun String.canParseAsIpAddress(): Boolean {
return VERIFY_AS_IP_ADDRESS.matches(this)
}

/** Returns true if we should void putting this this header in an exception or toString(). */
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
/** Returns true if we should void putting this this header in an exception or toString(). */
/** Returns true if we should void putting this header in an exception or toString(). */

@@ -249,6 +249,14 @@ fun String.canParseAsIpAddress(): Boolean {
return VERIFY_AS_IP_ADDRESS.matches(this)
}

/** Returns true if we should void putting this this header in an exception or toString(). */
fun isSensitiveHeader(name: String): Boolean {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this be a public API feature?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don’t think so. It’s the sort of thing you don’t know you need until it’s too late.

@yschimke
Copy link
Collaborator

yschimke commented Feb 7, 2021

Failing job looks like it's just circleci being woefully under provisioned recently https://app.circleci.com/pipelines/github/square/okhttp/4508/workflows/b41ede5e-98f7-4d2d-9dd4-79e655f4838f/jobs/20469

@swankjesse swankjesse merged commit dcc6483 into master Feb 8, 2021
yschimke pushed a commit to yschimke/okhttp that referenced this pull request Jul 4, 2021
swankjesse added a commit that referenced this pull request Jul 4, 2021
@swankjesse swankjesse deleted the jwilson.0206.redact_sensitive branch October 1, 2021 00:22
tristantarrant added a commit to tristantarrant/okhttp that referenced this pull request Nov 30, 2022
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.

None yet

2 participants