Skip to content

Commit

Permalink
Merge pull request #36 from fermyon/base-changes
Browse files Browse the repository at this point in the history
Change request shape test to reflect removal of base
  • Loading branch information
rylev authored Aug 26, 2024
2 parents 4312195 + abe703e commit f00b59c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
10 changes: 7 additions & 3 deletions components/request-shape/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,18 @@ fn check_url(req: &IncomingRequest) -> anyhow::Result<()> {
/// Check that the headers are as expected
fn check_headers(req: &IncomingRequest) -> anyhow::Result<()> {
let expected_headers = [
("spin-raw-component-route", "/:path_segment/:path_end/..."),
(
"spin-raw-component-route",
"/base/:path_segment/:path_end/...",
),
(
"spin-full-url",
"http://example.com/base/path/end/rest?key=value",
),
("spin-path-info", "/rest"),
("spin-base-path", "/base"),
("spin-component-route", "/:path_segment/:path_end"),
// Hardcoded base path for backwards compatibility
("spin-base-path", "/"),
("spin-component-route", "/base/:path_segment/:path_end"),
("spin-path-match-path-segment", "path"),
("spin-path-match-path-end", "end"),
("spin-matched-route", "/base/:path_segment/:path_end/..."),
Expand Down
5 changes: 1 addition & 4 deletions tests/request-shape/spin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@ name = "request-shape"
version = "0.1.0"
authors = ["Fermyon Engineering <[email protected]>"]

[application.trigger.http]
base = "/base"

[[trigger.http]]
route = "/:path_segment/:path_end/..."
route = "/base/:path_segment/:path_end/..."
component = "request-shape"

[component.request-shape]
Expand Down

0 comments on commit f00b59c

Please sign in to comment.