|
@ -355,6 +355,7 @@ func (s3a *S3ApiServer) doDeleteEmptyDirectories(client filer_pb.SeaweedFilerCli |
|
|
func (s3a *S3ApiServer) proxyToFiler(w http.ResponseWriter, r *http.Request, destUrl string, isWrite bool, responseFn func(proxyResponse *http.Response, w http.ResponseWriter) (statusCode int)) { |
|
|
func (s3a *S3ApiServer) proxyToFiler(w http.ResponseWriter, r *http.Request, destUrl string, isWrite bool, responseFn func(proxyResponse *http.Response, w http.ResponseWriter) (statusCode int)) { |
|
|
|
|
|
|
|
|
glog.V(3).Infof("s3 proxying %s to %s", r.Method, destUrl) |
|
|
glog.V(3).Infof("s3 proxying %s to %s", r.Method, destUrl) |
|
|
|
|
|
start := time.Now() |
|
|
|
|
|
|
|
|
proxyReq, err := http.NewRequest(r.Method, destUrl, r.Body) |
|
|
proxyReq, err := http.NewRequest(r.Method, destUrl, r.Body) |
|
|
|
|
|
|
|
@ -404,12 +405,12 @@ func (s3a *S3ApiServer) proxyToFiler(w http.ResponseWriter, r *http.Request, des |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if resp.StatusCode == http.StatusNotFound { |
|
|
if resp.StatusCode == http.StatusNotFound { |
|
|
s3err.WriteErrorResponse(w, r, s3err.ErrNoSuchKey) |
|
|
s3err.WriteErrorResponse(w, r, s3err.ErrNoSuchKey) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
TimeToFirstByte(r.Method, start, r) |
|
|
if resp.Header.Get(s3_constants.X_SeaweedFS_Header_Directory_Key) == "true" { |
|
|
if resp.Header.Get(s3_constants.X_SeaweedFS_Header_Directory_Key) == "true" { |
|
|
responseStatusCode := responseFn(resp, w) |
|
|
responseStatusCode := responseFn(resp, w) |
|
|
s3err.PostLog(r, responseStatusCode, s3err.ErrNone) |
|
|
s3err.PostLog(r, responseStatusCode, s3err.ErrNone) |
|
|