Hi Kyrylo,
Would you mind sharing your code for the transaction id header?

That way of extracting a header does work, and I've added a test as we were
missing that specific style actually:
https://github.com/akka/akka-http/pull/1047

I suspect you may have done something wrong in your header definition - are
you sure you defined everything that's needed?


See this test for more usage examples:
https://github.com/akka/akka-http/blob/master/akka-http-tests/src/test/scala/akka/http/scaladsl/server/ModeledCustomHeaderSpec.scala


On Fri, Apr 21, 2017 at 4:23 PM, Kyrylo Stokoz <[email protected]> wrote:

> Hi All,
>
> I`m trying to extract custom header from response object like this:
>
> response.header[`X-Transaction-Id`]
>
>
> but it always give me None, changing it to lookup by name return expected 
> value.
>
>
> response.headers.find(_.lowercaseName() == 
> `X-Transaction-Id`.name.toLowerCase)
>
>
> It looks like it is related to modeling custom headers as RawHeader.
>
> According to 
> http://doc.akka.io/docs/akka-http/10.0.5/scala/http/common/http-model.html:
>
> "Thanks to extending ModeledCustomHeader instead of the plain CustomHeader 
> such header can be matched"
>
>
> Should it apply to header extraction in the way above as well? Is it a bug? 
> or as designed?
>
>
> Regards,
>
> Kyrylo
>
> --
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/
> current/additional/faq.html
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
> ---
> You received this message because you are subscribed to the Google Groups
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Cheers,
Konrad 'ktoso' Malawski
Akka <http://akka.io/> @ Typesafe <http://typesafe.com/>

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to