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

Querystring support? #39

Open
ebunders opened this issue Jul 26, 2023 · 0 comments
Open

Querystring support? #39

ebunders opened this issue Jul 26, 2023 · 0 comments

Comments

@ebunders
Copy link

ebunders commented Jul 26, 2023

I find it hard to believe it, but it seems that the querystring of the request is totally ignored, and paths with querystrings are not matched. Given this code:

server.on({
    method: 'GET',
    path: '/test?foo=bar',
    reply: {
        status: 200,
        headers: {"content-type": "application/json"},
        body: JSON.stringify({what: 'params'})
    }
});

server.on({
    method: 'GET',
    path: '/test',
    reply: {
        status: 200,
        headers: {"content-type": "application/json"},
        body: JSON.stringify({what: 'no-params'})
    }
});

And then

❯ curl http://localhost:8888/test
{"what":"no-params"}
~ 
❯ curl http://localhost:8888/test?foo=bar
{"what":"no-params"}

Am I missing something?

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

1 participant