xiekeyang / oci-discovery

Contain the OCI Ref-engine Discovery specification and related specifications as an extention to the image specification.
Other
2 stars 1 forks source link

add Accept header to http request #22

Closed xiekeyang closed 7 years ago

xiekeyang commented 7 years ago

Signed-off-by: xiekeyang xiekeyang@huawei.com

xiekeyang commented 7 years ago

I'm not sure: only req.Header.Set("Accept") seems not enough. Should add more checking? :

if resp.Header.Get("Content-type") != "application/vnd.oci.ref-engines.v1+json; charset=utf-8"{
  return err
}
xiekeyang commented 7 years ago

@wking mentioned profit of context in 1, and give this parameter to refengine.Engine interface functions. However I'm not sure if it will really be used. In current code it seems do nothing. I agree in a net service context help to shutdown some handler gracefully, and can update context key/value under go routine. But if it is as well needed in a our HTTP client?