fix: need to manually cast errorPages to webappErrorPages
This commit is contained in:
parent
c2483aa7a9
commit
b03af65418
10
api/s5/s5.go
10
api/s5/s5.go
|
@ -1215,8 +1215,14 @@ func (s *S5API) directoryUpload(jc jape.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var webappErrorPages s5libmetadata.WebAppErrorPages
|
||||||
|
|
||||||
|
for code, page := range errorPages {
|
||||||
|
webappErrorPages[code] = page
|
||||||
|
}
|
||||||
|
|
||||||
// Generate metadata for the directory upload
|
// Generate metadata for the directory upload
|
||||||
app, err := s.createAppMetadata(name, tryFiles, errorPages, uploads)
|
app, err := s.createAppMetadata(name, tryFiles, webappErrorPages, uploads)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
s.sendErrorResponse(jc, err)
|
s.sendErrorResponse(jc, err)
|
||||||
return
|
return
|
||||||
|
@ -1274,7 +1280,7 @@ func (s *S5API) processMultipartFiles(r *http.Request) (map[string]*metadata.Upl
|
||||||
return uploadMap, nil
|
return uploadMap, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *S5API) createAppMetadata(name string, tryFiles []string, errorPages map[int]string, uploads map[string]*metadata.UploadMetadata) (*s5libmetadata.WebAppMetadata, error) {
|
func (s *S5API) createAppMetadata(name string, tryFiles []string, errorPages s5libmetadata.WebAppErrorPages, uploads map[string]*metadata.UploadMetadata) (*s5libmetadata.WebAppMetadata, error) {
|
||||||
filesMap := s5libmetadata.NewWebAppFileMap()
|
filesMap := s5libmetadata.NewWebAppFileMap()
|
||||||
|
|
||||||
for filename, upload := range uploads {
|
for filename, upload := range uploads {
|
||||||
|
|
Loading…
Reference in New Issue