-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minor API improvements #20
Conversation
…uestFilter for common use cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
// up to whomever made the request. | ||
trait Upstream[-AddressingConfig] { | ||
def metricsTag: String | ||
|
||
def addressRequest(request: HttpRequest, addressingConfig: AddressingConfig): HttpRequest | ||
|
||
def prepareRequestForDelivery(request: HttpRequest): HttpRequest = request | ||
def requestFilter: RequestFilter[Unit] = NoOpRequestFilter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we not maintain the verb form here? So filterRequest
and filterResponse
? Makes the calls in the HttpProxy
more readable in my opinion
--- upstream.requestFilter(addressedRequest, ())
+++ upstream.filterRequest(addressedRequest, ())
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The verbs don't apply here, since calling the method does nothing but return the filter. It doesn't apply anything like previously.
In HttpProxy
, there's apply
implicitly called, it's upstream.requestFilter.apply(addressedRequest, ())
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok, I did stumble across the signature here, but I didn't think of the implicit call to apply
in the HttpProxy
.
This one is probably best reviewed commit by commit. It's generally pretty self-explanatory.