Skip to content

Commit

Permalink
Fix #579: empty string at end of Sitelet endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarmil committed Jul 25, 2016
1 parent c89173b commit d315b29
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/sitelets/WebSharper.Sitelets/Router.fs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ module RouterUtil =
if uri.IsAbsoluteUri
then uri.AbsolutePath
else Uri.UnescapeDataString(uri.OriginalString) |> joinWithSlash "/"
|> trimFinalSlash

type Router<'Action when 'Action : equality> =
{
Expand All @@ -78,7 +77,7 @@ type Router<'Action when 'Action : equality> =
| _ -> this.DynamicLink(action)

member this.Route(req: Http.Request) =
match this.StaticRoutes.TryGetValue(path req.Uri) with
match this.StaticRoutes.TryGetValue(path req.Uri |> trimFinalSlash) with
| true, r -> Some r
| _ -> this.DynamicRoute(req)

Expand Down Expand Up @@ -201,7 +200,7 @@ module Router =
let prefix = joinWithSlash "/" prefix
let shift (loc: Location) =
if loc.IsAbsoluteUri then loc else
makeUri (joinWithSlash prefix (path loc))
makeUri (joinWithSlash prefix (path loc |> trimFinalSlash))
{
StaticRoutes =
let d = Dictionary()
Expand Down

0 comments on commit d315b29

Please sign in to comment.