Skip to content
This repository has been archived by the owner on Dec 22, 2022. It is now read-only.

Commit

Permalink
Fixed "invalid BidType: " error for lifestreet adapter (prebid#893)
Browse files Browse the repository at this point in the history
* Fixed "invalid BidType: " error for lifestreet adapter

* After run gofmt

* Used standard bid.ext type to get bid.ext.prebid.type
  • Loading branch information
Lifestreet authored and mansinahar committed May 29, 2019
1 parent 5ed24ae commit 935d462
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions adapters/lifestreet/lifestreet.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"context"
"encoding/json"
"fmt"
"github.com/prebid/prebid-server/openrtb_ext"
"io/ioutil"
"net/http"
"strings"
Expand Down Expand Up @@ -71,15 +72,27 @@ func (a *LifestreetAdapter) callOne(ctx context.Context, req *pbs.PBSRequest, re
}
bid := bidResp.SeatBid[0].Bid[0]

t := openrtb_ext.BidTypeBanner

if bid.Ext != nil {
var e openrtb_ext.ExtBid
err = json.Unmarshal(bid.Ext, &e)
if err != nil {
return
}
t = e.Prebid.Type
}

result.Bid = &pbs.PBSBid{
AdUnitCode: bid.ImpID,
Price: bid.Price,
Adm: bid.AdM,
Creative_id: bid.CrID,
Width: bid.W,
Height: bid.H,
DealId: bid.DealID,
NURL: bid.NURL,
AdUnitCode: bid.ImpID,
Price: bid.Price,
Adm: bid.AdM,
Creative_id: bid.CrID,
Width: bid.W,
Height: bid.H,
DealId: bid.DealID,
NURL: bid.NURL,
CreativeMediaType: string(t),
}
return
}
Expand Down

0 comments on commit 935d462

Please sign in to comment.