Fork me on GitHub

hey people 👋 … quick question regarding interceptors . I am trying to implement one to process a hmac signature to verify incoming requests on one of my webhooks. And even though I have placed this interceptor as the first in my interceptor stack, I can not seem to be able to retrieve the raw json body of the request from there i.e it is already null at that point. It seems that the underlying Inputstream has already been consumed. Also, I have some other stuff in my interceptors chain for e.g body-params but unfortunately I can not re-build the exact same request body as the original raw one for the hash calculation. What am I missing ? Is there a way for me to have this raw initial json body somehow saved in the context maybe ? thanks in adv.


@kaffein just call .reset on that inputstream


oh okay, I will try that out @isak :thumbsup: thanks for the hint


not always possible, sometimes streams are truly gone


might want to find/replace the interceptor that is doing the slurping


and make it slurp and hash, or slurp and leave the original

👍 1
🙏 1

It should be possible because I have done the same thing, but yea that might be better


oh okay @ghadi but I guess it might be some interceptor added implicitly by Pedestal then because I have already placed mine at the top of the chain in the service-map.