Open
Conversation
Accidentally clicking the link made me navigate to it, clicking back is not possible so i lost a password that way...
This header seems to be stuck in feature hell, and developers refuse to add a default-for-all kind of flag, so you need to define every scope you want to disable. See https://www.permissionspolicy.com/ to see just how lengthy the header becomes. Bug: w3c/webappsec-permissions-policy#189
/logo/asdf is not /logo
polarina
requested changes
Mar 19, 2025
| github.com/golang/gddo v0.0.0-20190419222130-af0f2af80721 | ||
| github.com/google/go-cmp v0.3.0 // indirect | ||
| github.com/lib/pq v1.1.1 | ||
| github.com/golang/gddo v0.0.0-20210115222349-20d68f94ee1f |
Collaborator
There was a problem hiding this comment.
There is only one caller that uses this library, to parse HTTP Accept headers. It is also responsible for everything in go.sum going bloated.
| @@ -1,9 +1,11 @@ | |||
| #!/bin/bash | |||
| #!/bin/bash -x | |||
Collaborator
There was a problem hiding this comment.
Perhaps change set -oeu pipefail to set -oeux pipefail?
| if helpers.HTTPAcceptCheck("application/json", r.Header) { | ||
| rw.Header().Set("Content-Security-Policy", contentSecurityPolicyJSON) | ||
| } else { | ||
| rw.Header().Set("Content-Security-Policy", contentSecurityPolicyHTML) |
Collaborator
There was a problem hiding this comment.
We got two policies, one for JSON and another for HTML, yet only one uniformally applied override? How about we use only one for the default as well?
| if err := rv.sv.db.ping(); err != nil { | ||
| log.Printf("db.Ping() returned %v\n", err) | ||
| rv.w.WriteHeader(http.StatusInternalServerError) | ||
| if len(rv.path) == 1 { |
Collaborator
There was a problem hiding this comment.
Reduce indentation.
if len(rv.path) != 1 {
return
}And move this and the switch into a new helper function.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.