Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passthrough does not account for host when checking for handlers #1057

Open
runspired opened this issue Sep 16, 2022 · 1 comment
Open

Passthrough does not account for host when checking for handlers #1057

runspired opened this issue Sep 16, 2022 · 1 comment

Comments

@runspired
Copy link

Given a passthrough defined like so: this.passthrough('/translations/**');

When running on a url like so: http://localhost:9003/3638/tests/index.html

and the file translations/en-us.json

Mirage will fail to find the passthrough handler as it considers the "path" to be 3638/tests/translations/en-us.json instead of translations/en-us.json

@cah-brian-gantzler
Copy link
Collaborator

I would expect that this is more a pretender issue than mirageJS. https://github.com/pretenderjs/pretender

A quick search found no issues open/closed that I think match your request. Host typically ends at the first /. I would suspect that you might have to determine this yourself, then adjust the namespace when defining the routes.

I have been extracting pretender to allow it to be optionally replaced with MSW https://mswjs.io/. I wonder if that would have the same problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants