Skip to content

Commit

Permalink
Fix misprint; Add url.PathEscape call for adunit URL parameter.
Browse files Browse the repository at this point in the history
  • Loading branch information
vchimishuk committed Feb 21, 2020
1 parent 286d9fd commit 81c2637
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 8 additions & 7 deletions adapters/adoppler/adoppler.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"errors"
"fmt"
"net/http"
"net/url"

"github.com/mxmCherry/openrtb"
"github.com/prebid/prebid-server/adapters"
Expand All @@ -26,15 +27,15 @@ type adsImpExt struct {
Video *adsVideoExt `json:"video"`
}

type Adoppler struct {
type AdopplerAdapter struct {
endpoint string
}

func NewAdopplerBidder(endpoint string) *Adoppler {
return &Adoppler{endpoint}
func NewAdopplerBidder(endpoint string) *AdopplerAdapter {
return &AdopplerAdapter{endpoint}
}

func (ads *Adoppler) MakeRequests(
func (ads *AdopplerAdapter) MakeRequests(
req *openrtb.BidRequest,
info *adapters.ExtraRequestInfo,
) (
Expand Down Expand Up @@ -65,7 +66,7 @@ func (ads *Adoppler) MakeRequests(
}

uri := fmt.Sprintf("%s/processHeaderBid/%s",
ads.endpoint, ext.AdUnit)
ads.endpoint, url.PathEscape(ext.AdUnit))
data := &adapters.RequestData{
Method: "POST",
Uri: uri,
Expand All @@ -78,7 +79,7 @@ func (ads *Adoppler) MakeRequests(
return datas, errs
}

func (ads *Adoppler) MakeBids(
func (ads *AdopplerAdapter) MakeBids(
intReq *openrtb.BidRequest,
extReq *adapters.RequestData,
resp *adapters.ResponseData,
Expand Down Expand Up @@ -136,7 +137,7 @@ func (ads *Adoppler) MakeBids(
tp, ok := impTypes[bid.ImpID]
if !ok {
err := &errortypes.BadServerResponse{
fmt.Sprintf("uknown impid: %s", bid.ImpID),
fmt.Sprintf("unknown impid: %s", bid.ImpID),
}
return nil, []error{err}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
"adm": "<b>a banner</b>"}]}],
"cur": "USD"}}}],
"expectedBidResponses": [],
"expectedMakeBidsErrors": [{"value": "uknown impid: invalid",
"expectedMakeBidsErrors": [{"value": "unknown impid: invalid",
"comparison": "literal"}]}

0 comments on commit 81c2637

Please sign in to comment.