Skip to content

Add recipe to migrate Tomcat LegacyCookieProcessor to Rfc6265CookieProcessor#1032

Closed
timtebeek wants to merge 1 commit into
mainfrom
tomcat-rfc6265-cookie-processor
Closed

Add recipe to migrate Tomcat LegacyCookieProcessor to Rfc6265CookieProcessor#1032
timtebeek wants to merge 1 commit into
mainfrom
tomcat-rfc6265-cookie-processor

Conversation

@timtebeek
Copy link
Copy Markdown
Member

@timtebeek timtebeek commented May 29, 2026

Adds org.openrewrite.java.spring.boot3.UseRfc6265CookieProcessor, a declarative recipe that rewrites the className attribute of the Tomcat <CookieProcessor> element from org.apache.tomcat.util.http.LegacyCookieProcessor to org.apache.tomcat.util.http.Rfc6265CookieProcessor in Tomcat configuration files (e.g. context.xml, server.xml).

<Context>
    <CookieProcessor className="org.apache.tomcat.util.http.LegacyCookieProcessor"/>
</Context>

becomes

<Context>
    <CookieProcessor className="org.apache.tomcat.util.http.Rfc6265CookieProcessor"/>
</Context>

Rfc6265CookieProcessor has been the Tomcat default since 8.5; LegacyCookieProcessor is retained only for backwards compatibility. The recipe is intentionally not wired into any version upgrade because RFC 6265 parsing is stricter than the legacy behavior, so it is offered as an opt-in change. The oldValue guard ensures only the legacy class is rewritten, leaving custom or already-migrated cookie processors untouched (covered by tests).

  • Reported via customer feedback (moderneinc/customer-requests#2462).

…ocessor

Adds UseRfc6265CookieProcessor, a declarative recipe that replaces the
className attribute of the Tomcat <CookieProcessor> element from
org.apache.tomcat.util.http.LegacyCookieProcessor to
org.apache.tomcat.util.http.Rfc6265CookieProcessor in Tomcat configuration
files such as context.xml and server.xml.
Copy link
Copy Markdown
Contributor

@Jenson3210 Jenson3210 left a comment

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor

@Jenson3210 Jenson3210 left a comment

Choose a reason for hiding this comment

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

Should this one not be created in rewrite-java-application-server or moderne-rewrite-spring?

@timtebeek timtebeek marked this pull request as draft May 29, 2026 11:44
@timtebeek timtebeek closed this May 29, 2026
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRewrite May 29, 2026
@timtebeek timtebeek deleted the tomcat-rfc6265-cookie-processor branch May 29, 2026 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants