Skip to content

Commit 9b87efe

Browse files
committed
extproc: drop the extproc prefix from shared header mutation errors
1 parent 468de83 commit 9b87efe

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

internal/xds/httpfilter/extconfig.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ func (hmr *HeaderMutationRules) ApplyAdditions(hvos []*v3corepb.HeaderValueOptio
126126
hmr = &HeaderMutationRules{}
127127
}
128128
if input == nil {
129-
return fmt.Errorf("extproc: input metadata is nil")
129+
return fmt.Errorf("input metadata is nil")
130130
}
131131
if hmr.DisallowAll {
132132
return nil
@@ -136,26 +136,26 @@ func (hmr *HeaderMutationRules) ApplyAdditions(hvos []*v3corepb.HeaderValueOptio
136136
header := hvo.GetHeader()
137137
key := header.GetKey()
138138
if err := validateHeaderKey(key); err != nil {
139-
return fmt.Errorf("extproc: invalid header mutation: %v", err)
139+
return fmt.Errorf("invalid header mutation: %v", err)
140140
}
141141

142142
value := header.GetValue()
143143
if strings.HasSuffix(key, "-bin") {
144144
value = string(header.GetRawValue())
145145
}
146146
if len(value) > maxHeaderSize {
147-
return fmt.Errorf("extproc: invalid header mutation: value for header key %q exceeds the maximum length of %d bytes", key, maxHeaderSize)
147+
return fmt.Errorf("invalid header mutation: value for header key %q exceeds the maximum length of %d bytes", key, maxHeaderSize)
148148
}
149149
// ValidatePair rejects values carrying bytes outside %x20-%x7E. It
150150
// skips the value check for "-bin" keys, whose values the transport
151151
// base64 encodes.
152152
if err := imetadata.ValidatePair(key, value); err != nil {
153-
return fmt.Errorf("extproc: invalid header mutation: %v", err)
153+
return fmt.Errorf("invalid header mutation: %v", err)
154154
}
155155

156156
if !hmr.allow(key) {
157157
if hmr.DisallowIsError {
158-
return fmt.Errorf("extproc: header mutation disallowed by headerMutationRules for header key %q", key)
158+
return fmt.Errorf("header mutation disallowed by headerMutationRules for header key %q", key)
159159
}
160160
continue
161161
}
@@ -194,19 +194,19 @@ func (hmr *HeaderMutationRules) ApplyRemovals(headersToRemove []string, input me
194194
hmr = &HeaderMutationRules{}
195195
}
196196
if input == nil {
197-
return fmt.Errorf("extproc: input metadata is nil")
197+
return fmt.Errorf("input metadata is nil")
198198
}
199199
if hmr.DisallowAll {
200200
return nil
201201
}
202202

203203
for _, header := range headersToRemove {
204204
if err := validateHeaderKey(header); err != nil {
205-
return fmt.Errorf("extproc: invalid header mutation: %v", err)
205+
return fmt.Errorf("invalid header mutation: %v", err)
206206
}
207207
if !hmr.allow(header) {
208208
if hmr.DisallowIsError {
209-
return fmt.Errorf("extproc: header mutation disallowed by headerMutationRules for header %q", header)
209+
return fmt.Errorf("header mutation disallowed by headerMutationRules for header %q", header)
210210
}
211211
continue
212212
}

0 commit comments

Comments
 (0)