File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed
Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -364,19 +364,16 @@ func proxyDockerAuthWithCache(c *gin.Context) {
364364 globalCache .SetToken (cacheKey , string (recorder .body ), ttl )
365365 }
366366
367- // 6. 写入实际响应(如果还没写入)
368- if ! recorder .written {
369- c .Writer = recorder .ResponseWriter
370- c .Data (recorder .statusCode , "application/json" , recorder .body )
371- }
367+ // 6. 写入实际响应
368+ c .Writer = recorder .ResponseWriter
369+ c .Data (recorder .statusCode , "application/json" , recorder .body )
372370}
373371
374372// ResponseRecorder HTTP响应记录器
375373type ResponseRecorder struct {
376374 gin.ResponseWriter
377375 statusCode int
378376 body []byte
379- written bool
380377}
381378
382379func (r * ResponseRecorder ) WriteHeader (code int ) {
@@ -385,7 +382,6 @@ func (r *ResponseRecorder) WriteHeader(code int) {
385382
386383func (r * ResponseRecorder ) Write (data []byte ) (int , error ) {
387384 r .body = append (r .body , data ... )
388- r .written = true
389385 return len (data ), nil
390386}
391387
You can’t perform that action at this time.
0 commit comments