Skip to content

Commit

Permalink
make tests work with file paths
Browse files Browse the repository at this point in the history
  • Loading branch information
davidnewhall committed Aug 5, 2024
1 parent 3cd4cc5 commit d091568
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/checkapp/checkapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/Notifiarr/notifiarr/pkg/mnd"
"github.com/Notifiarr/notifiarr/pkg/snapshot"
"github.com/gorilla/mux"
"golift.io/cnfgfile"
)

const (
Expand All @@ -39,6 +40,15 @@ func Test(orig *configfile.Config, writer http.ResponseWriter, req *http.Request
return
}

if _, err := cnfgfile.Parse(&posted, &cnfgfile.Opts{
Name: mnd.Title,
TransformPath: configfile.ExpandHomedir,
Prefix: "filepath:",
}); err != nil {
http.Error(writer, "Parsing extra config filepaths: "+err.Error(), http.StatusBadRequest)
return
}

index, _ := strconv.Atoi(mux.Vars(req)["index"])
reply, code := testInstance(req.Context(), &Input{
Real: orig,
Expand Down

0 comments on commit d091568

Please sign in to comment.