Compare commits
2 Commits
cb415a6f63
...
a514f4dcfa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a514f4dcfa | ||
|
|
2f9c917a08 |
@@ -2,6 +2,7 @@ package routes
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -17,14 +18,16 @@ func resolvePdfAssetPath(name string) (string, error) {
|
|||||||
return "", fmt.Errorf("env PDF_FONT_DIR not set")
|
return "", fmt.Errorf("env PDF_FONT_DIR not set")
|
||||||
}
|
}
|
||||||
|
|
||||||
// 반드시 absolute olmalı
|
// Mutlaka absolute olsun
|
||||||
if !filepath.IsAbs(base) {
|
if !filepath.IsAbs(base) {
|
||||||
return "", fmt.Errorf("PDF_FONT_DIR is not absolute: %s", base)
|
return "", fmt.Errorf("PDF_FONT_DIR must be absolute: %s", base)
|
||||||
}
|
}
|
||||||
|
|
||||||
full := filepath.Join(base, name)
|
full := filepath.Clean(filepath.Join(base, name))
|
||||||
|
|
||||||
|
// DEBUG
|
||||||
|
log.Printf("📄 PDF FONT PATH = %s", full)
|
||||||
|
|
||||||
// Mutlaka dosya var mı kontrol et
|
|
||||||
if _, err := os.Stat(full); err != nil {
|
if _, err := os.Stat(full); err != nil {
|
||||||
return "", fmt.Errorf("font not found: %s (%v)", full, err)
|
return "", fmt.Errorf("font not found: %s (%v)", full, err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user