Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Added new adapter for CPMStar ad network banners and video #1159
Added new adapter for CPMStar ad network banners and video #1159
Changes from 2 commits
38e44d1
7c22920
58e42a6
378d15b
fc1cb8f
b649c6b
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
It looks like you're using
json.Unmarshal
to validate the extension content is valid json. Consider passing it through as it and letting your servers reject invalid extensions.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.
Error responses are going to be a lot more informative here if the user uses a quoted string for placementId instead of a number, for example. So we'd prefer to maintain the unmarshalling here. I've removed the re-marshalling, per your other comment.
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.
If the
request *openrtb.BidRequest
argument passed to this function came with an emptyImp
array, we could probably be sending out an empty request. Are sure we don't want to return an error in caselen(request.Imp) == 0
?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.
Other adapters return a
BadInput
error whenresponse.StatusCode == http.StatusBadRequest
do we want that in our context?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.
This is done on the next line where it checks
if responseData.StatusCode != http.StatusOK {
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.
Other adapters also throw an
errortypes.BadServerResponse
error whenUnmarshal
goes wrong here, would that also be desirable?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.
Why do we only allocate capacity for one bid? Do we not expect more than one matching bid inside the
bidResponse
?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.
Do we want to
break
thefor
loop once the matching bid we are expecting is found?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.
It would be desirable to set a test case up cover the scenario where no matching bid was found. Maybe even when a request returning a
StatusCode
different thanStatusOK