Search code examples
f#suave

How to handle pathScan decoding of url encoded parameters?


I have something like :-

 pathScan "/blah/%s" (fun x) -> (sprintf "%A"  x) |> json)

and what it shows me if I do /blah/AT%2BVER%3F is the url encoded data. Is there a way to get this decoded automatically? or do I need to parse all my parameters ( which seems a bit odd )


Solution

  • Some older versions require manually decoding. Note that a pull request was accepted (and is now in the current release) which should address this in the next release.

    Currently, the best option is to either upgrade to the latest Suave or run this through System.Web.HttpUtility.UrlDecode yourself (as this is the mechanism being used by Suave vCurrent).