deislabs / wagi

Write HTTP handlers in WebAssembly with a minimal amount of work
Apache License 2.0
889 stars 44 forks source link

Fix a couple of routing errors #129

Closed itowlson closed 3 years ago

itowlson commented 3 years ago

The main purpose of this is to address the issue identified in #128, where if a static route ended in / and a dynamic route began with '/' then WAGI composed a route containing // and it didn't work.

Working on this exposed another (rather embarrassing) bug: if you had a wildcard route /foo/... then it did a starts_with check on the stuff before the slash, so /foobar would match. So this fixes that too (yes, sorry, it is all in one commit, but it wasn't worth teasing apart).

This does NOT close #128 because we still need to look at the AssemblyScript issue.