Skip to content

Conversation

@jlloh
Copy link

@jlloh jlloh commented Sep 9, 2025

PR Type

Feature

PR Checklist

  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • A changelog entry has been made for the appropriate packages.
  • Format code with the nightly rustfmt (cargo +nightly fmt).

Overview

Extract HeaderMap and pass it along so it can be used in the handler.

@jlloh
Copy link
Author

jlloh commented Sep 9, 2025

Hello, I am trying to use the crate, but I realise that I need Header information from the http request as well for my purposes. I'm not sure whether it's more appropriate to put it in the ProtoBuf struct or the ProtoBufMessage struct, will adhere to your guidance.

Also note that I'm currently cloning the map which is probably not ideal, once I know which struct to put it in, I'll also work on avoiding the clone.

@jlloh
Copy link
Author

jlloh commented Sep 11, 2025

Tagging @robjtede for comment.

@jlloh jlloh changed the title [NOJIRA-000] Extract http headers for actix-protobuf Extract http headers for actix-protobuf Sep 11, 2025
Copy link
Member

@JohnTitor JohnTitor left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. I, however, would like to reject this PR as making ProtoBuf<T> always carry a HeaderMap forces every existing handler to break, with no alternative other than fabricating an empty map. Headers should be configurable/extractable in the request.

@JohnTitor JohnTitor closed this Nov 2, 2025
@jlloh
Copy link
Author

jlloh commented Nov 13, 2025

Noted with thanks. Do you mean it should be done with extractors? Happy to try to raise another MR in the approach you suggest, but may need some small pointers on the approach to take.

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.

2 participants