question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow using wildcard in request URI

See original GitHub issue

Currently when using the httpserver.expect_request function, I am only allowed to use the full URI string. It would be nice if it would also accept URI’s with wildcards or regex.

For instance, I have an endpoint called GET /users/{USER_ID}/role that will return the role of a user with a given USER_ID. If I would like to mock this endpoint I would have to specify a httpserver.expect_request for each of the users I am using in my tests: httpserver.expect_request("/users/1/role").respond_with_json("admin") httpserver.expect_request("/users/2/role").respond_with_json("admin") httpserver.expect_request("/users/3/role").respond_with_json("admin") It would be way more convenient if we could just pass in a wildcard instead: httpserver.expect_request("/users/*/role").respond_with_json("admin")

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
csernazscommented, Aug 5, 2020

I’ve released 0.3.5. I’m closing this issue in the hope that packages on pypi are also usable (I’ve already checked, but who knows…). 😃 If you see any problem, feel free to open a new issue.

Thanks for using this library!

1reaction
csernazscommented, Aug 5, 2020

I’ve merged the PR request, thanks for your comments! I think I’ll do a release later today.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Wildcards and regular expressions in URL
Wildcards. Kerio Control allows using wildcards when you create a content rule based on a URL or a URL group: Select the HTTP ......
Read more >
URL Path Wildcard
Purpose: Identifies requests by whether the requested URL points to a relative path that matches a pattern defined by a wildcardThis type of...
Read more >
How to use wildcard in URL and querystring ? - Google Groups
Is there any possibility to use wildcard (like "*") in the path ? So that we can use any dynamic values. Ex: /customer/*/123...
Read more >
authorize request with wildcard preceding url in spring web ...
i have a rest endpoint of the form. {pathvariable}/foo/. and i want to permit access to ...
Read more >
Solved: Using wildcard in URL filtering - Cisco Community
Solved: hi, How can i block all connections to *.microsoft.com (for example)? Can i use custom URL object *.microsoft.com or firepower doesnt support ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found