mirror of
https://github.com/kataras/iris.git
synced 2025-03-14 08:16:28 +01:00
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
This commit is contained in:
parent
b2cc3a2871
commit
b4c9e7124a
|
@ -517,9 +517,10 @@ func (su *Supervisor) shutdownOnInterrupt(ctx context.Context) {
|
||||||
// fileExists tries to report whether a local physical file of "filename" exists.
|
// fileExists tries to report whether a local physical file of "filename" exists.
|
||||||
func fileExists(filename string) bool {
|
func fileExists(filename string) bool {
|
||||||
info, err := os.Stat(filename)
|
info, err := os.Stat(filename)
|
||||||
if os.IsNotExist(err) {
|
if err != nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return !info.IsDir()
|
return !info.IsDir()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user