Skip to content

Commit

Permalink
Escaping test
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbiehl committed Feb 14, 2024
1 parent 442b714 commit 9ea75a9
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 0 deletions.
Empty file.
12 changes: 12 additions & 0 deletions test/golden/file-package-escaping-1.output.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
capture: |-
Just
FlatfileCapture
{ fileAbsoluteUrl =
Just "https://output.com/some-nice-path/very-nice/really+nice"
, fileVariables =
fromList [ ( "path" , "some-nice-path/very-nice/really+nice" ) ]
, filePackage = "21c24cd1-73fa-4970-8a6a-bc570e55b91e"
}
headers:
Location: https://output.com/some-nice-path/very-nice/really+nice
status: 302
14 changes: 14 additions & 0 deletions test/golden/file-package-escaping-1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This tests a catch-all pattern with a file variable. This
# Using {+path} to render out the captured value will result
# in invalid encoding in the output.
# The encoding issue makes this a pattern that you don't want to use
path: "/some-nice-path/very-nice/really+nice"
headers:
Host: nicedomain.com
manifest:
rules:
- type: file-v1
incoming-path: "/{+path}"
domain: nicedomain.com
package-id: 21c24cd1-73fa-4970-8a6a-bc570e55b91e
outgoing-url: https://output.com/{+path}
Empty file.
10 changes: 10 additions & 0 deletions test/golden/file-package-escaping.output.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
capture: |-
Just
FlatfileCapture
{ fileAbsoluteUrl = Just "https://output.com/really%2Bnice"
, fileVariables = fromList [ ( "variable" , "really+nice" ) ]
, filePackage = "21c24cd1-73fa-4970-8a6a-bc570e55b91e"
}
headers:
Location: https://output.com/really%2Bnice
status: 302
11 changes: 11 additions & 0 deletions test/golden/file-package-escaping.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# multiple variables
path: "/some-nice-path/very-nice/really+nice"
headers:
Host: nicedomain.com
manifest:
rules:
- type: file-v1
incoming-path: "/some-nice-path/very-nice/{+variable}"
domain: nicedomain.com
package-id: 21c24cd1-73fa-4970-8a6a-bc570e55b91e
outgoing-url: https://output.com/{variable}

0 comments on commit 9ea75a9

Please sign in to comment.