Repository navigation
Ad2iction Bid Adapter: send bid requests as text/plain to avoid a CORS preflight - #16295
patmmccann wants to merge 1 commit into
Conversation
…S preflight Removes contentType: 'application/json' from the bid request options, so core sends the same JSON body as text/plain and the browser skips the CORS preflight. See prebid#16293 and prebid#12948. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Re-probed with the preflight probe's new With the test params from The endpoint accepted |
This looks broken: the endpoint seems to ignore the body when it's sent as We POSTed an adapter-shaped body to
The text/plain response to a valid body has the same shape as the JSON response to an empty |
|
Thanks for the PR and for the probe work. I'm the maintainer of ad2iction (prebid@ad2iction.com). Please hold this PR for now. We haven't yet confirmed that our endpoint parses the request body when it is sent as text/plain, and the evidence so far suggests it may not. The probe results (no-bid with both content types) don't show that the body is read. The comment from @dgirardi-bot above points the same way: with a valid body containing Our adapter keeps We'll check the server side and report back here. If the endpoint needs a change, we'll make it and verify with a real placement before this PR is merged. |
|
Following up on my earlier comment: @dgirardi-bot's probe was right, and our endpoint only parsed the body when the Content-Type was exactly
Verified against production after the deploy:
Since this PR was closed, I've opened #16344 with the same change. Thanks @patmmccann and @dgirardi-bot for the probing. |
Type of change
Description of change
modules/ad2ictionBidAdapter.jssetoptions.contentType: 'application/json'on its bid request, which made the browser send a CORS preflight before every bid request. A preflight costs about as much network time as the bid request itself (see #12948).This drops the option, so core sends the same JSON body as
text/plain, like most bid adapters.withCredentials: falseis kept. The body is an object, which coreJSON.stringifys regardless of the content type, so the payload is unchanged.The preflight probe in #16293 sent the endpoint the same body both ways and got the same response:
application/jsontext/plainRelated: #16293 (Prebid 12 proposal), #12948. Model PR: #16294.
@charlie0228 (maintainer email: prebid@ad2iction.com), please confirm your server accepts
text/plain.Tests
The spec now asserts the bid request has no
contentTypeand still sendswithCredentials: false.ad2ictionBidAdapter_spec.jspasses; lint is clean.🤖 Generated with Claude Code