allow subclassing of request #116
Comments
Hello, I made an attempt and it somehow worked but if another filter do the same the handler will end up with a request proxying a request proxying a request etc and I am not sure how to retrieve the right level containing my data. Here's my sample in memory session filter. The filter creates a RequestWithSession and pass it to the service. An implicit is used to retrieve the RequestWithSession from the Request (I had to climb two levels in my test but may be it could end with request.request.request if another filter is involved, I am not sure?).
The usage is:
Trying to cast to RequestWithSession and climbing up the hierarchy until it work may be a workaround but it feels wrong :) I know it's not recommended by Finagle but since a user cannot easily modify the whole framework signature, maybe a request context could do the trick ?
I am quite new to finagle and finatra and still a beginner with scala so there must be a nicer way of doing this, any info is very much appreciated :) Best regards Laurent |
Subclassing Request is now discouraged in favor of using Request.ctx |
Make sure it's possible to subclass a finatra.Request and pass it through the Router.
The text was updated successfully, but these errors were encountered: