Remove the completed step 4 migration roadmap
This commit is contained in:
@@ -3,6 +3,7 @@ package httpadapter
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"mime"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
@@ -26,6 +27,10 @@ func TestRestrictedArtifactReaderReadsContainedFiles(t *testing.T) {
|
||||
if err := os.WriteFile(filepath.Join(outside, "secret.txt"), []byte("denied"), 0o644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
expectedContentType := mime.TypeByExtension(filepath.Ext(inputPath))
|
||||
if expectedContentType == "" {
|
||||
t.Fatal("expected built-in HTML content type")
|
||||
}
|
||||
|
||||
reader, err := NewRestrictedArtifactReader(root, 0)
|
||||
if err != nil {
|
||||
@@ -43,8 +48,8 @@ func TestRestrictedArtifactReaderReadsContainedFiles(t *testing.T) {
|
||||
if artifact.Name != "input.html" || artifact.URI != inputPath || artifact.Size != int64(len("allowed")) || string(artifact.Body) != "allowed" {
|
||||
t.Fatalf("unexpected artifact metadata: %#v", artifact)
|
||||
}
|
||||
if artifact.ContentType != "text/html; charset=utf-8" {
|
||||
t.Fatalf("unexpected artifact content type: %q", artifact.ContentType)
|
||||
if artifact.ContentType != expectedContentType {
|
||||
t.Fatalf("unexpected artifact content type: got %q, want %q", artifact.ContentType, expectedContentType)
|
||||
}
|
||||
if artifact.Hash != artifactHash([]byte("allowed")) {
|
||||
t.Fatalf("unexpected artifact hash: %q", artifact.Hash)
|
||||
|
||||
Reference in New Issue
Block a user