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.

Changing Uri when copying a Request should clear pathInfo

See original GitHub issue

When copying a request object and supplying a new uri, e.g. req.copy(uri = uri("/new")), pathInfo does not currently get cleared. This results in confusing behavior as the previous pathInfo isn’t necessarily valid anymore in the new context. Thus, the more intuitive behavior would be to clear the pathInfo when uri is changed so that a new, “fresh” copy of the request object is obtained.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
sportanovacommented, Jun 12, 2017

I’d like to take a crack at this - would the best way be to create a custom copy method?

0reactions
rossabakercommented, Jun 27, 2017

Fixed by #1213

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to overwrite pathInfo in a Symfony 2 Request
All the logic works properly and updates the original request. The problem is, even if I change the 'REQUEST_URI', the property $pathInfo remains...
Read more >
pathinfo - Manual - PHP
Here is a simple function that gets the extension of a file. Simply using PATHINFO_EXTENSION will yield incorrect results if the path contains...
Read more >
How to get "extended" path info from URL in a plugin
1 Answer 1 ... In reply to "Update 1": The code worked fine for me. So,. I'm still getting a 404 when I...
Read more >
Clarify behaviour of getRequestURI(), getContextPath ...
so my conclusion is that if we retain path parameters, we have to retain them all the way through the processing chain and...
Read more >
URL Rewrite Module Configuration Reference - Microsoft Learn
The URL Rewrite Module rewrites request URLs to simple, user-friendly, and search-engine friendly addresses that are displayed to users or in ...
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