natefaubion / purescript-routing-duplex

Unified parsing and printing for routes in PureScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failed pattern match for invalid URL encoded path

dederer opened this issue · comments

In production, I got a runtime error in the parsePath function from the Routing.Duplex.Parser module:

stack: Error: Failed pattern match at Data.Maybe (line 281, column 1 - line 281, column 46): Nothing

The reason for the error is an invalid URL encoded string "%D0%BF%D0".

For example, this command results in an error:

parsePath "https://example.com?keyword=%D0%BF%D0"

Yeah, we need to remove the unsafe usage here:

unsafeDecodeURIComponent = unsafePartial fromJust <<< decodeURIComponent