Skip to content

Conversation

@thibaudledent
Copy link

Description

The current implementation of ServerRequest from org.zalando.logbook.spring.webflux returns an empty attribute map, regardless of whether any attributes are present (see HttpRequest).

This improvement exposes the Spring server request attributes through ServerRequest.getAttributes().

Motivation and Context

In a Spring Boot application, I would like to pass a userId inside a WebFilter using HttpAttributes, and then later retrieve this value in LogbookWebFilter via an AttributeExtractor in order to include it in the logs. However, in my current setup, the HttpAttributes are always empty when accessed through the extractor.

See: zalando/logbook#2175

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All commits are signed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant