mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 02:15:48 +02:00
enhance: show the form error details of CertificateEditor
This commit is contained in:
parent
8581bdd3c6
commit
b0a3989ef4
4 changed files with 166 additions and 128 deletions
|
@ -33,6 +33,9 @@ func IsPrivateKey(pemStr string) bool {
|
|||
|
||||
// IsPublicKeyPath checks if the file at the given path is a public key or not exists.
|
||||
func IsPublicKeyPath(path string) bool {
|
||||
if path == "" {
|
||||
return false
|
||||
}
|
||||
_, err := os.Stat(path)
|
||||
|
||||
if err != nil {
|
||||
|
@ -52,6 +55,10 @@ func IsPublicKeyPath(path string) bool {
|
|||
|
||||
// IsPrivateKeyPath checks if the file at the given path is a private key or not exists.
|
||||
func IsPrivateKeyPath(path string) bool {
|
||||
if path == "" {
|
||||
return false
|
||||
}
|
||||
|
||||
_, err := os.Stat(path)
|
||||
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue