Compare commits

..

No commits in common. "main" and "v0.3.0" have entirely different histories.
main ... v0.3.0

2 changed files with 4 additions and 9 deletions

View file

@ -53,5 +53,5 @@ func New(filename string) (config Config, err error) {
func (config *Config) ParseApplicationConfig(v any) { func (config *Config) ParseApplicationConfig(v any) {
yStr, _ := yaml.Marshal(config.Application) yStr, _ := yaml.Marshal(config.Application)
yaml.Unmarshal(yStr, v) yaml.Unmarshal(yStr, &v)
} }

11
pkg.go
View file

@ -305,14 +305,9 @@ func (service *Service) StaticHandler(w http.ResponseWriter, r *http.Request, se
r.URL.Path = fmt.Sprintf("/%s/%s", comp[1], comp[2]) r.URL.Path = fmt.Sprintf("/%s/%s", comp[1], comp[2])
p := fmt.Sprintf(service.staticDirectory+"/%s/%s", comp[1], comp[2]) p := fmt.Sprintf(service.staticDirectory+"/%s/%s", comp[1], comp[2])
_, err = os.Stat(p)
if service.useStaticDirectory { if err == nil {
_, err = os.Stat(p) service.staticLocalFileserver.ServeHTTP(w, r)
if err == nil {
service.staticLocalFileserver.ServeHTTP(w, r)
} else {
service.staticEmbeddedFileserver.ServeHTTP(w, r)
}
} else { } else {
service.staticEmbeddedFileserver.ServeHTTP(w, r) service.staticEmbeddedFileserver.ServeHTTP(w, r)
} }