|
@@ -26,6 +26,7 @@ import cn.hutool.core.lang.Tuple;
|
|
import sun.misc.BASE64Encoder;
|
|
import sun.misc.BASE64Encoder;
|
|
|
|
|
|
import javax.servlet.ServletOutputStream;
|
|
import javax.servlet.ServletOutputStream;
|
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
@SuppressWarnings("restriction")
|
|
@SuppressWarnings("restriction")
|
|
@@ -152,15 +153,19 @@ public class HttpClientUtil {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- public synchronized String post(String url, String content, Integer timeout, Map<String, String> headerMap,HttpServletResponse response, HttpServletResponse request) throws Exception {
|
|
|
|
|
|
+ public synchronized String post(String url, String content, Integer timeout, Map<String, String> headerMap,HttpServletResponse response, HttpServletRequest request) throws Exception {
|
|
if (Constant.http_interval > 0) {
|
|
if (Constant.http_interval > 0) {
|
|
Thread.sleep(Constant.http_interval);
|
|
Thread.sleep(Constant.http_interval);
|
|
}
|
|
}
|
|
|
|
|
|
HttpPost httpost = new HttpPost(url);
|
|
HttpPost httpost = new HttpPost(url);
|
|
- if(!url.contains("login")||!url.contains("getCaptchaBase64"))
|
|
|
|
|
|
+ if (!url.contains("login")&&!url.contains("getCaptchaBase64"))
|
|
{
|
|
{
|
|
- httpost.setHeader("Authorization", request.getHeader("Authorization"));
|
|
|
|
|
|
+ String authorization=request.getHeader("Authorization");
|
|
|
|
+ if(authorization!=null)
|
|
|
|
+ {
|
|
|
|
+ httpost.setHeader("Authorization", authorization);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
if (headerMap != null) {
|
|
if (headerMap != null) {
|
|
for (String key : headerMap.keySet()) {
|
|
for (String key : headerMap.keySet()) {
|