Skip to content

Implement getCookies, getLocalPort, and getLocalAddr methods in RequestWrapper #6

@marinedayo

Description

@marinedayo

Logback Access 2.0.1 and Jetty 12.

The methods getCookies, getLocalPort, and getLocalAddr currently exist within the RequestWrapper class but do not return meaningful data as one might expect.

These methods will be used in my project and I expect to improve them.
Moreover, the improvements to getCookies and getLocalPort methods are useful as they correlate with the values used in logback-access's pattern layouts, such as %reqCookie for cookies and %localPort for the local port. (For some reason, %localIP works without the getLocalAddr implementation.

I propose the following changes:

  • getCookies(): This method should be improved to convert and return an array of Cookie objects, derived from the List<HttpCookie> returned by Request::getCookies.
  • getLocalPort(): By using Request::getLocalPort, this method could be improved to return the port number.
  • getLocalAddr(): Similarly by using Request::getLocalAddr, this method could be improved to return the local address.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions