String referer =request.getHeader("Referer"); if(referer==null || !referer.startsWith("http://127.0.0.1:8080/webp/")){ response.sendRedirect("/webp/RequestError"); return; }
防盗链
原文:http://my.oschina.net/u/1861097/blog/404642