PSPDFKit-labs / bypass

Bypass provides a quick way to create a custom plug that can be put in place instead of an actual HTTP server to return prebaked responses to client requests.
https://hex.pm/packages/bypass
MIT License
964 stars 111 forks source link

bypass does not support paths containing ":" #122

Open zoten opened 2 years ago

zoten commented 2 years ago

Hi everyone, and thanks for the great work! I'm having some troubles with bypass, since I have to work with paths in the form

/a/strange/path/dotted:strange.string.that.may:happen

The problem is that both the expectation definition (hackable by using :any) and the call handling analyze the path directly using Plug's build_path_match function here, that finds the :strange.string.that.may and complain thinking it is a match's definition.

I opened a branch showing the issue with a test case here ( test )

Has anyone got any workaround for this particular case? I'd gladly try to provide a patch, if you have some indication if you already have an idea of how it could work.

Thank you!

notslang commented 1 year ago

I'm running into the same issue when upgrading Bypass from 1.0.0 to 2.1.0. This wasn't a problem in older versions of Bypass.

artemk commented 1 year ago

same issue here. Trying to tests Google Business Api, which has lots of ":requestLaunch" things in api endpoints, but looks like after this pull merged (https://github.com/PSPDFKit-labs/bypass/pull/93) it is no longer possible.

guys you should either put some flag so that people can skip build_path_match or find out other way. it is no sense adding features which break others' .