fix macos panic dereferencing when passing a []byte version of certificate or key as cert|keyFileOrContents to iris.TLS()
if len(certFileOrContents) > 1024 the error returned will be Filename too long and os.IsNotExist(err) will be false
@@ -517,9 +517,10 @@ func (su *Supervisor) shutdownOnInterrupt(ctx context.Context) {
// fileExists tries to report whether a local physical file of "filename" exists.
func fileExists(filename string) bool {
info, err := os.Stat(filename)
- if os.IsNotExist(err) {
+ if err != nil {
return false
}
+
return !info.IsDir()
}
