Skip to content

fix: forward browser user-agent in OpenRTB device.ua field#276

Open
ChristianPavilonis wants to merge 1 commit intomainfrom
feature/user-agent-headers-prebid
Open

fix: forward browser user-agent in OpenRTB device.ua field#276
ChristianPavilonis wants to merge 1 commit intomainfrom
feature/user-agent-headers-prebid

Conversation

@ChristianPavilonis
Copy link
Collaborator

@ChristianPavilonis ChristianPavilonis commented Feb 10, 2026

closes #264, #130

Summary

  • Add ua field to the OpenRTB Device struct so user-agent is serialized into bid requests
  • Update to_openrtb in the Prebid integration to map DeviceInfo.user_agent into device.ua
  • Fix DeviceInfo construction to always include user-agent and IP, not just when geo lookup succeeds

Context

Bidders like Kargo filter out requests with non-browser user-agents. Because device.ua was never set, Prebid Server would fall back to the HTTP UA of the server-to-server call (e.g. the Fastly runtime), causing bidders to return 204 No Content on every request. Verified via isolated curl testing that UA is the sole deciding factor.

Changes

File Change
crates/common/src/openrtb.rs Added ua: Option<String> to Device
crates/common/src/integrations/prebid.rs Map user_agent into device.ua; use .map() instead of .and_then() so device is present even without geo
crates/common/src/auction/formats.rs Always construct Some(DeviceInfo { .. }) with geo as optional inside, instead of gating on geo lookup

Refactoring

File Change
crates/common/src/streaming_processor.rs Extract shared decompress_and_process helper to deduplicate identical decompress→process→write logic across gzip, deflate, and brotli *_to_none methods
crates/common/src/proxy.rs Extract finalize_response helper to consolidate repeated stream_passthrough branching (4 call sites)
crates/common/src/integrations/prebid.rs vec![][] for static cdn_patterns array
crates/common/src/auction/formats.rs Use HashMap directly instead of std::collections::HashMap

@ChristianPavilonis ChristianPavilonis marked this pull request as ready for review February 11, 2026 14:04
@aram356 aram356 requested a review from prk-Jr February 12, 2026 16:38

/// Process gzip compressed input to uncompressed output (decompression only)
fn process_gzip_to_none<R: Read, W: Write>(
/// Decompress input, process content, and write uncompressed output.
Copy link
Collaborator

Choose a reason for hiding this comment

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

❓ What are the changes to decompression? Please update summary

Copy link
Collaborator Author

@ChristianPavilonis ChristianPavilonis Feb 13, 2026

Choose a reason for hiding this comment

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

Updated, with refactor notes.

Probably should've been separate pr.

@aram356
Copy link
Collaborator

aram356 commented Feb 13, 2026

@jevansnyc Per https://www.iab.com/wp-content/uploads/2016/03/OpenRTB-API-Specification-Version-2-5-FINAL.pdf

We need to think about passing some of the additional parameters. Can we document this in another ticket?

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.

Prebid OpenRTB requests missing device.ua, causing bidders to return no-bid

2 participants