fix: need to manually cast errorPages to webappErrorPages

This commit is contained in:
Derrick Hammer 2024-03-03 05:24:03 -05:00
parent c2483aa7a9
commit b03af65418
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 8 additions and 2 deletions

View File

@ -1215,8 +1215,14 @@ func (s *S5API) directoryUpload(jc jape.Context) {
return
}
var webappErrorPages s5libmetadata.WebAppErrorPages
for code, page := range errorPages {
webappErrorPages[code] = page
}
// 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 {
s.sendErrorResponse(jc, err)
return
@ -1274,7 +1280,7 @@ func (s *S5API) processMultipartFiles(r *http.Request) (map[string]*metadata.Upl
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()
for filename, upload := range uploads {