On Thursday, 24 September 2015 15:09:07 UTC+1, Konrad Malawski  wrote:
> I mis-clicked when accepting this email to be pushed to the mailing list, 
> sorry Jose!
> Posting on Jose's behalf, will answer soon:
> 
> 
> 
> 
> 
> I need to sign the response, and the signature depends on the response entity 
> as a String, so far I have achieve this but I couldn't figure out how to do 
> it without waiting 
> 
> (I know, I am looking for the right solution) for the Unmarshaller to 
> unmarshall the response entity. My code looks something like:
> 
> 
> 
> 
> mapResponse { response =>
> 
>   val timestamp = Instant.now().getEpochSecond
> 
>   // FIXME: Await here, sure there is a way of access the response entity
> 
>   val payload: String = 
> DigestUtils.md5Hex(Await.result(Unmarshal(response.entity).to[String], 
> 1.second))
> 
>   val signature = signatureGenerator.generate(timestamp, 
> response.status.intValue, payload, tolerance)
> 
>   response mapHeaders (_ :+ `X-Signature`(signature))
> 
> }
> 
> 
> 
> 
> Can anyone please advise? I've tried several other directives, but had no 
> success.
> 
> 
> 
> 
> Thanks,
> 
> Jose
> 
> 
>  

I found mapRouteResultWith with takes a RouteResult => Future[RouteResult], 
this solved my problems.

Cheers

-- 
>>>>>>>>>>      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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to