ServiceStack Handler Not Found When Periods Presen

2019-07-16 14:46发布

问题:

When doing a GET with an email address (periods present) in the middle of the path we are getting an error from ServiceStack saying "Handler for Request Not Found". When moving the email address portion of the route to the last section of the path it is successful.

  • Fails "/path/to/me%40example.com/action"
  • Success "/path/to/action/me%40example.com"

We have been able to work around it by keeping the email address at the end of the path, but when there is more than one parameter with the potential of having periods we have to rely on a POST to accomplish the call. Any suggestions for work-arounds?

回答1:

There are 2 component separators in ServiceStack's Routes: . and /, here's an example showing different Route path ServiceStack supports.

You can try url encoding the . so its %2E otherwise just add the action as a querystring parameter, e.g: /path/to/me%40example.com?action=action