当前位置:网站首页>September 17, 2020 gateway business process has two tasks: referer certification and non commodity Templating
September 17, 2020 gateway business process has two tasks: referer certification and non commodity Templating
2022-06-29 10:19:00 【qqq2018】
gateway The main function :
External request ->1.gw Resolve request ->2. towards ad-server Send a request ->3. analysis ad-server An answer from ->4. Send an answer to the outside
Look outside , Just give gateway send out request, then gateway Return to one response.
// External supply gateway send out request, then gateway Return to one response.
bool BidRequestHandler::ProcessBidRequest(const shared_ptr<HttpRequest> request, shared_ptr<HttpResponse> response) {
// Where are the four steps in the code
// 1.
shared_ptr<BidRequest> bid_request = handler->ParseBidRequest();
// 2.3.
bool ret = handler->CallServices(request, bid_request, ads_req, ads_resp, fill_data_arr, err_msg);
// 2.
err_msg = PrepareCallAds(request, bid_request, ads_req);
// 3.
ads_resp = GetAdsResponse(ads_req);
// 4.
if (handler->WriteBidResponse(fill_data_arr, response))
Realize two small functions :
1. Non commodity ( Such as shops ) templated . Set up some uniform templates for the front end , Replace the previous front-end definition of one style at a time , The back end will process after judgment .
Implementation method : Set up several templates , Provide front-end options .
2. add to referer Verify and log .
Purpose : Control some web pages , Keep these pages from advertising .
Implementation method : from HTTP Of Headers Remove from Reference( Records the of the parent page url), If there is one in the blacklist, it will be killed and returned directly , No advertising . hold referer Fall log -> Sinan ( It was originally called compass in the code )
http Of request Requested header in ,referer The page that initiated the request is recorded ( Is where the request came from ).
An example : Search for a content from Baidu's homepage request head :
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9
Accept-Encoding: gzip, deflate, br
Accept-Language: zh-CN,zh;q=0.9
Connection: keep-alive
Cookie: ……
Host: www.baidu.com
Referer: https://www.baidu.com/
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: same-origin
Sec-Fetch-User: ?1
Upgrade-Insecure-Requests: 1
User-Agent: ……
You can see referer Baidu Homepage , Explain that this request is from Baidu's home page .
边栏推荐
- Codeforces Round #657 Div. 2
- 1021 deep root (25 points)
- Using rancher to build kubernetes cluster
- 1098 Insertion or Heap Sort (25 分)
- Nacos environmental isolation
- 2019-11-10训练总结
- Slide the custom control to close the activity control
- Codeforces Round #652 (Div. 2)
- Summary after the 2009 ICPC Shanghai regional competition
- sympy的dsolve函数
猜你喜欢

Nacos registry cluster

Application of keil5 integrated development environment for single chip microcomputer

Codeforces Round #659 (Div. 2)

任务调度器之Azkaban的使用

Beautiful ruins around Kiev -- a safe guide to Chernobyl!

Text of the basic component of the shutter

這個開源項目超哇塞,手寫照片在線生成

EDA与VHDL题库

RecyclerView 通用适配器封装

Sixteen system counter and flow lamp
随机推荐
2019.10.27 training summary
2019.10.20训练总结
The stones game
Seaweedfs security configuration
两个栈的模拟题
Flutter 基础组件之 Text
1146 Topological Order (25 分)
L2-3 这是二叉搜索树吗?-题解超精彩哦
Listview of the basic component of the shutter
HDU 4578 transformation (segment tree + skillful lazy tag placement)
自定义控件之下载控件1(DownloadView1)
container
Pipeline details of IPC (interprocess communication)
If I were in Beijing, where would it be better to open an account? In addition, is it safe to open an account online now?
HDU 4578 Transformation(线段树+有技巧的懒标记下放)
Codeforces Round #657 Div. 2
520 diamond Championship 2021
Ural1517 freedom of choice [suffix array: longest common continuous substring]
1098 Insertion or Heap Sort (25 分)
Web漏洞手动检测分析