Skip to content

Conversation

@Gunni
Copy link
Owner

@Gunni Gunni commented Jan 20, 2025

No description provided.

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
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
Copy link
Collaborator

Choose a reason for hiding this comment

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

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
Copy link
Collaborator

Choose a reason for hiding this comment

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

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)
Copy link
Collaborator

Choose a reason for hiding this comment

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

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 {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Reduce indentation.

if len(rv.path) != 1 {
	return
}

And move this and the switch into a new helper function.

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.

3 participants