mux icon indicating copy to clipboard operation
mux copied to clipboard

Allow SkipClean to be evaluated on each route independently.

Open gavbaa opened this issue 5 years ago • 8 comments

This provides a solution to #460 . Cleaning is now moved into the route matcher, and is only activated if SkipClean has been set for that specific router (whether explicitly, or by inheritance from a parent route upon creation).

Note that due to the lack of parent knowledge in a Route/Router (which was removed a few months ago), SkipClean() changes only apply to routes that were created after the SkipClean change. Since we have no handle or reference to a Subrouter() once it's been created from the parent router (it's only stored as a matcher interface), we can't make SkipClean() trickle down to the already existing children. New ones will pick it up though. Since this is how other current properties behave, this seemed to be expected behavior.

gavbaa avatar Mar 21 '19 14:03 gavbaa

Thank you. I’m really behind in review backlog, but a quick ask: also document the “existing children” behavior in the godoc for SkipClean?

Bonus points for adding an example to the README too.

On Thu, Mar 21, 2019 at 7:40 AM George Vilches [email protected] wrote:

This provides a solution to #460 https://github.com/gorilla/mux/issues/460 . Cleaning is now moved into the route matcher, and is only activated if SkipClean has been set for that specific router (whether explicitly, or by inheritance from a parent route upon creation).

Note that due to the lack of parent knowledge in a Route/Router (which was removed a few months ago), SkipClean() changes only apply to routes that were created after the SkipClean change. Since we have no handle or reference to a Subrouter() once it's been created from the parent router (it's only stored as a matcher interface), we can't make SkipClean() trickle down to the already existing children. New ones will pick it up though. Since this is how other current properties behave, this seemed to be expected behavior.

You can view, comment on, or merge this pull request online at:

https://github.com/gorilla/mux/pull/463 Commit Summary

  • Allow SkipClean to be evaluated on each route independently.

File Changes

Patch Links:

  • https://github.com/gorilla/mux/pull/463.patch
  • https://github.com/gorilla/mux/pull/463.diff

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/gorilla/mux/pull/463, or mute the thread https://github.com/notifications/unsubscribe-auth/AABIcHrNMoxNmfrtroTy9JR-Er5jUm8nks5vY5nVgaJpZM4cBlwI .

elithrar avatar Mar 21 '19 14:03 elithrar

Hey @gavbaa - are you still interested in finishing this one off?

elithrar avatar Jun 29 '19 18:06 elithrar

Yes, just have to set some time aside to go through and address the comments.

gavbaa avatar Jul 05 '19 15:07 gavbaa

Is there any way that I can help to get this merged? I need this!!

theverything avatar Jan 13 '20 22:01 theverything

@theverything you could create your own branch and complete the remainder of the work if you'd like.

fharding1 avatar Jan 13 '20 22:01 fharding1

Hey @gavbaa, @theverything - are you guys working on this PR?

amustaque97 avatar Jun 24 '22 06:06 amustaque97

@gavbaa If you would like to resolve the conflict with this pull request we can work on getting it reviewed and merged. Thanks

coreydaley avatar Aug 17 '23 16:08 coreydaley

Just noting no response as yet - will plan on coming back around to this if there's further updates.

jaitaiwan avatar Feb 10 '24 05:02 jaitaiwan