Skip to content

MS-427 Add request ID to response headers locally#691

Merged
luhmirin-s merged 1 commit into
release/2024.1.0from
bugfix/MS-427-add-request-id-locally
Apr 22, 2024
Merged

MS-427 Add request ID to response headers locally#691
luhmirin-s merged 1 commit into
release/2024.1.0from
bugfix/MS-427-add-request-id-locally

Conversation

@luhmirin-s
Copy link
Copy Markdown
Contributor

No description provided.

@luhmirin-s luhmirin-s requested review from a team, BurningAXE, TristramN, alex-vt, alexandr-simprints, ethiery, meladRaouf and ybourgery and removed request for a team April 22, 2024 07:22
@cla-bot cla-bot Bot added the ... label Apr 22, 2024
@luhmirin-s luhmirin-s marked this pull request as ready for review April 22, 2024 07:22
@sonarqubecloud
Copy link
Copy Markdown

@luhmirin-s luhmirin-s merged commit 987e4ff into release/2024.1.0 Apr 22, 2024
@luhmirin-s luhmirin-s deleted the bugfix/MS-427-add-request-id-locally branch April 22, 2024 09:27
// Adding same header to both request and response to
// track the request across network logs and analytics events.
val newRequest = chain.request().newBuilder().addHeader(REQUEST_ID_HEADER, requestId).build()
return@Interceptor chain.proceed(newRequest).newBuilder().addHeader(REQUEST_ID_HEADER, requestId).build()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Smart!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not really, but this works. :D IMO, this is a bit of misuse, since the client should not add the response data 🤷🏻

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Agreed, but as far as hacks go, this is probably the smallest possible change you could make to make this work 😂 Code golf winner

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants