当前位置:网站首页>Implement anti-theft chain through referer request header
Implement anti-theft chain through referer request header
2022-07-25 12:13:00 【JackLi0812】
adopt Referer Request head realizes anti-theft chain
<a href="${pageContext.request.contextPath }/NewsServlet"> Big news </a>public class NewsServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/html;charset=utf-8");
response.getWriter().write(" This great Xia eats steamed stuffed buns ....");
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doGet(request, response);
}
}
public class NewsServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/html;charset=utf-8");
String referer = request.getHeader("Referer");
if(referer == null || "".equals(referer) || !referer.contains("localhost/")) {
response.sendRedirect(request.getContextPath() + "/index.jsp");
return;
}
response.getWriter().write(" This great Xia eats steamed stuffed buns ....");
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doGet(request, response);
}
}

边栏推荐
- 浅谈低代码技术在物流管理中的应用与创新
- R语言ggpubr包ggarrange函数将多幅图像组合起来、annotate_figure函数为组合图像添加注释、注解、标注信息、fig.lab参数添加图像标签、fig.lab.face参数指定样式
- PHP curl post x-www-form-urlencoded
- The bank's wealth management subsidiary accumulates power to distribute a shares; The rectification of cash management financial products was accelerated
- R语言使用wilcox.test函数执行wilcox符号秩检验获取总体中位数(median)的置信区间(默认输出结果包括95%置信水平的置信区间)
- Introduction to redis
- JS interview question: handwriting throttle function
- Ups and downs of Apple's supply chain in the past decade: foreign head teachers and their Chinese students
- aaaaaaaaaaA heH heH nuN
- Qin long, a technical expert of Alibaba cloud: a prerequisite for reliability assurance - how to carry out chaos engineering on the cloud
猜你喜欢

【GCN-CTR】DC-GNN: Decoupled GNN for Improving and Accelerating Large-Scale E-commerce Retrieval WWW22

马斯克的“灵魂永生”:一半炒作,一半忽悠

Heterogeneous graph neural network for recommendation system problems (ackrec, hfgn)

winddows 计划任务执行bat 执行PHP文件 失败的解决办法

Qin long, a technical expert of Alibaba cloud: a prerequisite for reliability assurance - how to carry out chaos engineering on the cloud

浅谈低代码技术在物流管理中的应用与创新

RestTemplate与Ribbon简单使用

OSPF comprehensive experiment

Brpc source code analysis (V) -- detailed explanation of basic resource pool

【GCN-RS】Towards Representation Alignment and Uniformity in Collaborative Filtering (KDD‘22)
随机推荐
Video Caption(跨模态视频摘要/字幕生成)
Brpc source code analysis (V) -- detailed explanation of basic resource pool
Brpc source code analysis (IV) -- bthread mechanism
Brpc source code analysis (VII) -- worker bthread scheduling based on parkinglot
对比学习的应用(LCGNN,VideoMoCo,GraphCL,XMC-GAN)
【AI4Code】《Pythia: AI-assisted Code Completion System》(KDD 2019)
面试官:“同学,你做过真实落地项目吗?”
dirReader. Readentries compatibility issues. Exception error domexception
Median (二分答案 + 二分查找)
给生活加点惊喜,做创意生活的原型设计师丨编程挑战赛 x 选手分享
【GCN-RS】Region or Global? A Principle for Negative Sampling in Graph-based Recommendation (TKDE‘22)
[multimodal] transferrec: learning transferable recommendation from texture of modality feedback arXiv '22
【Debias】Model-Agnostic Counterfactual Reasoning for Eliminating Popularity Bias in RS(KDD‘21)
NLP知识----pytorch,反向传播,预测型任务的一些小碎块笔记
【无标题】
selenium使用———xpath和模拟输入和模拟点击协作
RestTemplate与Ribbon简单使用
brpc源码解析(一)—— rpc服务添加以及服务器启动主要过程
氢能创业大赛 | 国家能源局科技司副司长刘亚芳:构建高质量创新体系是我国氢能产业发展的核心
GPT plus money (OpenAI CLIP,DALL-E)