Skip to content

Commit

Permalink
✨ Fix typo and improve error message format.
Browse files Browse the repository at this point in the history
  • Loading branch information
enc committed May 8, 2024
1 parent 044e217 commit 5093dbe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions internal/provider/data_source_docker_registry_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ type TokenResponse struct {
// Parses key/value pairs from a WWW-Authenticate header
func parseAuthHeader(header string) map[string]string {
parts := strings.SplitN(header, " ", 2)
parts = regexp.MustCompile(`\w+\=\".*?\"|\w+[^\s\"]+?`).FindAllString(parts[1], -1) // expression to match auth headers.
parts = regexp.MustCompile(`\w+=".*?"|\w+[^\s"]+?`).FindAllString(parts[1], -1) // expression to match auth headers.
opts := make(map[string]string)

for _, part := range parts {
Expand Down Expand Up @@ -230,7 +230,7 @@ func getAuthToken(authHeader string, username string, password string, client *h
func doDigestRequest(req *http.Request, client *http.Client) (*http.Response, error) {
digestResponse, err := client.Do(req)
if err != nil {
return nil, fmt.Errorf("Error during registry request: %s", err)
return nil, fmt.Errorf("error during registry request: %s", err)
}

if digestResponse.StatusCode != http.StatusOK {
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/resource_docker_image_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ func TestAccDockerImage_build(t *testing.T) {
}

const testDockerFileExample = `
FROM python:3-stretch
FROM python:3-bookworm
WORKDIR /app
Expand Down

0 comments on commit 5093dbe

Please sign in to comment.