Two faults found on review
A second Accept value would have overwritten the first, because the header was Set per value rather than Added. One value is all any caller passes today, so nothing was wrong — but a helper that quietly keeps only the last of what it was given is a trap for whoever passes two. And a replayed announcement that could not be written was published as an empty body: a fact on the mesh that says nothing, which the reader can only log and drop. It is now said and skipped, because a body that cannot be marshalled is this program's fault rather than the bus's.
This commit is contained in:
@@ -137,7 +137,7 @@ func (r Registry) has(ctx context.Context, url string, accept ...string) (bool,
|
||||
return false, err
|
||||
}
|
||||
for _, media := range accept {
|
||||
request.Header.Set("Accept", media)
|
||||
request.Header.Add("Accept", media)
|
||||
}
|
||||
response, err := r.client().Do(request)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user