Skip to content

Omit empty on 'Target json.RawMessage' to avoid sending invalid json in bid request #968

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

Merged
merged 2 commits into from
Jul 19, 2019

Conversation

potatogopher
Copy link
Contributor

If a target was not provided for the Rubicon adapter then it's value is set to an empty string which is invalid json. Resulting in an invalid request. Omitting the field if it's empty fixes this issue.

#967

mansinahar
mansinahar previously approved these changes Jul 19, 2019
@@ -53,7 +53,7 @@ type rubiconImpExtRPTrack struct {

Copy link
Contributor

@guscarreon guscarreon Jul 19, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are Inventory and Visitor not necessary to omit if empty?

 40 type rubiconParams struct {
 41     AccountId int                `json:"accountId"`
 42     SiteId    int                `json:"siteId"`
 43     ZoneId    int                `json:"zoneId"`
 44     Inventory json.RawMessage    `json:"inventory"`
 45     Visitor   json.RawMessage    `json:"visitor"`
 46     Video     rubiconVideoParams `json:"video"`
 47 }
 48
adapters/rubicon/rubicon.go

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot a few lines. Thank you.

Copy link
Contributor

@guscarreon guscarreon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@mansinahar mansinahar merged commit 7374057 into prebid:master Jul 19, 2019
@potatogopher potatogopher deleted the rubicon-adapter-fix branch July 31, 2019 18:34
katsuo5 pushed a commit to flux-dev-team/prebid-server-1 that referenced this pull request Dec 1, 2020
…in bid request (prebid#968)

* Omitempty on 'Target json.RawMessage' to avoid sending invalid in bid request

* Omit empty additional fields
katsuo5 pushed a commit to flux-dev-team/prebid-server-1 that referenced this pull request Dec 2, 2020
…in bid request (prebid#968)

* Omitempty on 'Target json.RawMessage' to avoid sending invalid in bid request

* Omit empty additional fields
katsuo5 pushed a commit to flux-dev-team/prebid-server-1 that referenced this pull request Dec 4, 2020
…in bid request (prebid#968)

* Omitempty on 'Target json.RawMessage' to avoid sending invalid in bid request

* Omit empty additional fields
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants