Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8a03d0dbe7 |
@@ -295,10 +295,9 @@ func TestHandleImage_AllowlistOrSignature(t *testing.T) {
|
|||||||
// host can be, and checks that each is refused with 400 naming the host as
|
// host can be, and checks that each is refused with 400 naming the host as
|
||||||
// decoded: allowlistedHost with a character after it that a URL host cannot
|
// decoded: allowlistedHost with a character after it that a URL host cannot
|
||||||
// hold, percent-encoded, an IPv6 address without brackets, and brackets
|
// hold, percent-encoded, an IPv6 address without brackets, and brackets
|
||||||
// around something that is not an IPv6 address. A "?" or "#" after
|
// around something that is not an IPv6 address. Later steps put the host
|
||||||
// allowlistedHost would otherwise end the host when the source URL is read,
|
// unparsed into the allowlist check, the cache key and the upstream URL, so
|
||||||
// so the request would pass the allowlist and be fetched and cached under a
|
// such a host is refused first.
|
||||||
// host that is not the one fetched.
|
|
||||||
func TestHandleImage_InvalidHost_Returns400(t *testing.T) {
|
func TestHandleImage_InvalidHost_Returns400(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
@@ -369,10 +368,9 @@ func TestHandleImage_HostForms_Served(t *testing.T) {
|
|||||||
|
|
||||||
// TestHandleImage_HashInSourcePathOrQuery_Returns400 sends image URLs whose
|
// TestHandleImage_HashInSourcePathOrQuery_Returns400 sends image URLs whose
|
||||||
// source path or source query holds a "#", written as %23, and checks that
|
// source path or source query holds a "#", written as %23, and checks that
|
||||||
// each is refused with 400, the one signed for that source path included. The
|
// each is refused with 400, the one signed for that source path included.
|
||||||
// source URL would otherwise end at the "#" when it is fetched, so each text
|
// A "#" starts a URL's fragment, so neither the source path nor the source
|
||||||
// after it would fetch the image at photoPath and cache it under keys of its
|
// query may hold one.
|
||||||
// own.
|
|
||||||
func TestHandleImage_HashInSourcePathOrQuery_Returns400(t *testing.T) {
|
func TestHandleImage_HashInSourcePathOrQuery_Returns400(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user