Skip to content

Commit

Permalink
fix: use valid path to the for_each inspector settings (#129)
Browse files Browse the repository at this point in the history
* fix: use valid path to the for_each inspector settings

* test: use CDN backed text file for ExampleGet_http
  • Loading branch information
shellcromancer committed Aug 10, 2023
1 parent 4721ffa commit 65d838d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build/config/substation.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@
},
for_each(options=$.defaults.inspector.for_each.options,
settings=$.interfaces.inspector.settings): {
local opt = std.mergePatch($.defaults.processor.inspector.for_each.options, options),
local opt = std.mergePatch($.defaults.inspector.for_each.options, options),

assert $.helpers.inspector.validate(settings) : 'invalid inspector settings',
local s = std.mergePatch($.interfaces.inspector.settings, settings),
Expand Down
4 changes: 2 additions & 2 deletions internal/file/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func ExampleGet_local() {
}

func ExampleGet_http() {
location := "https://www.gutenberg.org/files/2701/2701-h/2701-h.htm"
location := "https://example.com"

// a local copy of the HTTP body is created and must be removed when it's no longer needed, regardless of errors
path, err := file.Get(context.TODO(), location)
Expand All @@ -75,7 +75,7 @@ func ExampleGet_http() {
panic(err)
}

prefix := strings.HasPrefix(string(buf), "<!DOCTYPE")
prefix := strings.HasPrefix(strings.ToUpper(string(buf)), "<!DOCTYPE")
fmt.Println(prefix)

// Output: true
Expand Down

0 comments on commit 65d838d

Please sign in to comment.