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

Preserve request caret in withPathInfo #2728

merged 4 commits into from Jul 23, 2019


Copy link

commented Jul 17, 2019

Request#withPathInfo should preserve the position of the caret, an internal attribute that splits the URI path into scriptName and pathInfo.

Fixes #2726. See #1183, #1213 for more historical context.

@rossabaker rossabaker added the bug label Jul 17, 2019

def withPathInfo(pi: String): Self = {
val oldCaret = caret
withUri(uri.withPath(scriptName + pi)).withCaret(oldCaret)

This comment has been minimized.

Copy link

nicktelford Jul 17, 2019

Instead of having to explicitly preserve the caret, couldn't you just do:

copy(uri = uri.withPath(scriptName + pi))

This comment has been minimized.

Copy link

rossabaker Jul 19, 2019

Author Member

👍 That's a good point. withUri clears the caret, but this can use copy directly. I changed it to this.


aeons approved these changes Jul 22, 2019

@rossabaker rossabaker merged commit 91bdba6 into http4s:series/0.20 Jul 23, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.