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
merged 4 commits into from Jul 23, 2019
Merged

Conversation

@rossabaker
Copy link
Member

@rossabaker rossabaker 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)
Copy link

@nicktelford nicktelford Jul 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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

Loading

Copy link
Member Author

@rossabaker rossabaker Jul 19, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Loading

aeons
aeons approved these changes Jul 22, 2019
@rossabaker rossabaker merged commit 91bdba6 into http4s:series/0.20 Jul 23, 2019
1 check passed
Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants