mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-11-29 05:49:03 +08:00
Merge pull request #424 from listeng/master
Return json data when content-type is "application/json"
This commit is contained in:
commit
f7ff98c747
@ -74,7 +74,12 @@ func (fs *FilerServer) listDirectoryHandler(w http.ResponseWriter, r *http.Reque
|
||||
lastFileName,
|
||||
shouldDisplayLoadMore,
|
||||
}
|
||||
ui.StatusTpl.Execute(w, args)
|
||||
|
||||
if strings.ToLower(r.Header.Get("Content-Type")) == "application/json" {
|
||||
writeJsonQuiet(w, r, http.StatusOK, args)
|
||||
} else {
|
||||
ui.StatusTpl.Execute(w, args)
|
||||
}
|
||||
}
|
||||
|
||||
func (fs *FilerServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request, isGetMethod bool) {
|
||||
|
Loading…
Reference in New Issue
Block a user