map: Replace placeholders with regex groups#3991
Conversation
|
I don't think this is quite right. The linked issue is asking to essentially do the same as the |
|
@francislavoie it good? Or better? |
|
Hmm. I'm not sure that's still quite right. The typical regexp placeholder involves a name, because you could have more than one regexp in your handler chain (i.e. a I think we need to figure out how to tell the |
|
@francislavoie I'm just getting to this now, but I'm confused. What was wrong with the initial commit? The current commit looks way complicated. |
|
Hmm are you sure? Linked issue says:
|
|
Oh, I see, my bad. I misunderstood how the first implementation was meant to be used because there was no explanation or associated test. I figured we would use the same regexp placeholders like |
|
I'm pretty sure we can restore the first commit @rajat315315 -- but keep the later commits. |
|
Sure |
|
I believe we want to keep this one: acb5ff3 And any related test cases. :) |
I'm not sure about this statement.. |
|
By "later commits", Matt means the changes to the tests. Basically just revert the changes after the first commit, then add tests. |
mholt
left a comment
There was a problem hiding this comment.
Cool, let's try this out. Hopefully nobody wants literal ${1} strings in their outputs. :)
caddyserver/caddy#3991 The `outputs` bit was getting a bit long so I split it up into multiple paragraphs. The capture group explanation is copied from the `path_regexp` matcher docs. Added bullets in front of the example cases, because the newlines get collapsed in markdown otherwise, unless we either add bullets or double newlines. I think bullets work better here.
|
Hello everyone, |
Fixes #3971