mirror of
https://github.com/lightninglabs/aperture.git
synced 2025-12-18 09:34:20 +01:00
proxy+pricer: pass in the entire HTTP requests for GetPrice
In this commit, we modify the `GetPrice` method and interface to accept the full request instead of _just_ the path. For backwards compat, we leave the path in place, but also include the full serialized HTTP request.
This commit is contained in:
@@ -155,9 +155,7 @@ func (p *Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
// resources.
|
||||
acceptAuth := p.authenticator.Accept(&r.Header, resourceName)
|
||||
if !acceptAuth {
|
||||
price, err := target.pricer.GetPrice(
|
||||
r.Context(), r.URL.Path,
|
||||
)
|
||||
price, err := target.pricer.GetPrice(r.Context(), r)
|
||||
if err != nil {
|
||||
prefixLog.Errorf("error getting "+
|
||||
"resource price: %v", err)
|
||||
@@ -197,7 +195,7 @@ func (p *Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
if !ok {
|
||||
price, err := target.pricer.GetPrice(
|
||||
r.Context(), r.URL.Path,
|
||||
r.Context(), r,
|
||||
)
|
||||
if err != nil {
|
||||
prefixLog.Errorf("error getting "+
|
||||
|
||||
Reference in New Issue
Block a user