Upgrade to new Gitlab Version 13.9 on Saturday 19th April 20:00. Expect an interruption of about 30 to 60 minutes

Unverified Commit 0f77486a authored by Jürgen Enge's avatar Jürgen Enge Committed by GitHub

Merge pull request #3 from je4/dev

Dev
parents d514c981 9c48bd70
......@@ -15,3 +15,4 @@
# Dependency directories (remove the comment below to include it)
# vendor/
/test/
......@@ -116,5 +116,6 @@ func LoadConfig(filepath string) Config {
if pwd != "" {
conf.SFTP.Password = pwd
}
return conf
}
......@@ -33,6 +33,7 @@ const (
ACTALLPROTO = ACTFILE | ACTHTTP | ACTHTTPS
ACTALL = ACTALLPROTO | ACTHEAD
ACTFILEHEAD = ACTFILE | ACTHEAD
ACTFILEFULL = ACTFILE & ^ACTHEAD
)
var ACTString map[ActionCapability]string = map[ActionCapability]string{
......@@ -52,14 +53,13 @@ var ACTAction map[string]ActionCapability = map[string]ActionCapability{
// for toml decoding
func (a *ActionCapability) UnmarshalText(text []byte) error {
var ok bool
*a, ok = ACTAction[string(text)]
*a, ok = ACTAction[string(text)]
if !ok {
return fmt.Errorf("invalid action capability: %s", string(text))
}
return nil
}
var ErrMimeNotApplicable = errors.New("mime type not applicable for action")
type Action interface {
......
......@@ -199,7 +199,7 @@ func (s *Server) loadSFTP(uri *url.URL, writer io.Writer) (int64, error) {
}
*/
*/
/*
loads part of data and gets mime type
......@@ -247,7 +247,6 @@ func (s *Server) getContent(uri *url.URL, forceDownloadRegexp *regexp.Regexp, wr
mimetype = http.DetectContentType(buf)
}
mimetype = ClearMime(mimetype)
return
}
......@@ -360,6 +359,11 @@ func (s *Server) doIndex(param ActionParam) (map[string]interface{}, error) {
theUri = tmpUri
}
}
if !fulldownload && (caps&(^ACTFILEFULL)) == 0 {
s.log.Infof("%s: no full download. action not applicable", actionstr)
errors[actionstr] = fmt.Errorf("no full download. action not applicable").Error()
continue
}
s.log.Infof("Action [%v] %s: %s", key, actionstr, theUri.String())
actionresult, err := action.Do(theUri, &mimetype, &width, &height, &duration)
if err == ErrMimeNotApplicable {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment