fix get file metadata bug (#5394)

* Removed problematic if statement

This if statement was causing the value of option.AllowedOrigins to be always equal to "*". Now the values in the config file will be used when present. This allows for people who don't need this feature to not update their security.toml files.

* Update filer_server_handers_read.go

* Updated filer responses to invalid requests
This commit is contained in:
jerebear12
2024-03-18 13:08:16 -05:00
committed by GitHub
parent 8a2b3879b9
commit 7091269e65
2 changed files with 11 additions and 6 deletions

View File

@@ -2,6 +2,7 @@ package weed_server
import (
"context"
"errors"
"net/http"
"strconv"
"strings"
@@ -12,14 +13,14 @@ import (
"github.com/seaweedfs/seaweedfs/weed/util"
)
// listDirectoryHandler lists directories and folers under a directory
// listDirectoryHandler lists directories and folders under a directory
// files are sorted by name and paginated via "lastFileName" and "limit".
// sub directories are listed on the first page, when "lastFileName"
// is empty.
func (fs *FilerServer) listDirectoryHandler(w http.ResponseWriter, r *http.Request) {
if fs.option.ExposeDirectoryData == false {
http.NotFound(w, r)
writeJsonError(w, r, http.StatusForbidden, errors.New("ui is disabled"))
return
}