Skip to content

Commit

Permalink
Merge pull request #1946 from lann/fix-base-no-slash
Browse files Browse the repository at this point in the history
trigger-http: Fix `base` routing without leading slash
  • Loading branch information
lann authored Oct 26, 2023
2 parents e29eabe + a32ee4a commit 7e65dc5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion crates/trigger-http/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,13 @@ impl TriggerExecutor for HttpTrigger {
type RunConfig = CliArgs;

async fn new(engine: TriggerAppEngine<Self>) -> Result<Self> {
let base = engine
let mut base = engine
.app()
.require_metadata(spin_http::trigger::METADATA_KEY)?
.base;
if !base.starts_with('/') {
base = format!("/{base}");
}

let component_routes = engine
.trigger_configs()
Expand Down

0 comments on commit 7e65dc5

Please sign in to comment.