#5033 Fix scoped Sessions plugin not sending Set-Cookie without call.respond()#5511
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAfter pipeline execution, routing now responds with the current response status if the call remains unhandled; added a test verifying that setting a session and only a response status emits a Set-Cookie header. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| application.monitor.raise(RoutingCallStarted, routingCall) | ||
| try { | ||
| routingCallPipeline.execute(routingApplicationCall) | ||
| if (!routingApplicationCall.isHandled && routingApplicationCall.response.status() != null) { |
There was a problem hiding this comment.
Just a nitpick
I would use let instead of !! operator
if (!routingApplicationCall.isHandled) {
routingApplicationCall.response.status()?.let { status ->
routingApplicationCall.respond(status)
}
}There was a problem hiding this comment.
Good point, updated. Thanks for the review!
zibet27
left a comment
There was a problem hiding this comment.
LGTM
@fru1tworld Thank you for the fix!
PS: I'll rebase the branch to release/3.x, so it can be included in the next patch release. Or you can do it by running the switch-base-branch.sh script in the project root
049538f to
1b74906
Compare
|
Rebased onto |
Subsystem
Server, ktor-server-core (routing)
Motivation
Fixes #5033. Scoped
Sessionsplugin doesn't sendSet-Cookiewhen handler sets status withoutcall.respond().Solution
Call
respond()throughRoutingPipelineCallwhen handler set status but didn't respond, so scoped sendPipeline interceptors fire.