Just to add my vote. I'm with Claudio on this one.
Surely it's "Input Validation 101" ..... Validate the input yes, but don't tamper with what's not yours .... >It is not what we do and IMO trying to fiddle out bad path >attributes and still use the crippled rest smells like routing loops >comming soon to a network near you.