on master help sign in
uri-encode capture values in the generated javascript code for servant-jquery
e3af6a6Alp Mestanogullari
src/Servant/JQuery/Internal.hs+1−1
@@ -35,7 +35,7 @@ segmentToStr :: Segment -> Bool -> String
35segmentToStr (Static s) notTheEnd =
35segmentToStr (Static s) notTheEnd =
36 if notTheEnd then s else s ++ "'"
36 if notTheEnd then s else s ++ "'"
37segmentToStr (Cap s) notTheEnd =
37segmentToStr (Cap s) notTheEnd =
38− "' + " ++ s ++ if notTheEnd then " + '" else ""
38+ "' + encodeURIComponent(" ++ s ++ if notTheEnd then ") + '" else ")"
39
39
40type Path = [Segment]
40type Path = [Segment]
41
41