|
11 | 11 | import javax.xml.parsers.*;
|
12 | 12 |
|
13 | 13 | import burp.IHttpRequestResponse;
|
| 14 | +import burp.IRequestInfo; |
14 | 15 | import burp.IResponseInfo;
|
15 | 16 | import burp.WSDLParser;
|
16 | 17 | import com.sun.xml.internal.ws.api.model.wsdl.WSDLModel;
|
@@ -414,7 +415,13 @@ protected Import parseImport(Element importEl,
|
414 | 415 |
|
415 | 416 | if (importedDef == null)
|
416 | 417 | {
|
417 |
| - byte[] request = WSDLParser.helpers.buildHttpMessage(WSDLParser.headers,new byte[]{}); |
| 418 | + List<String> headers = WSDLParser.headers; |
| 419 | + byte[] getRequest = WSDLParser.helpers.buildHttpRequest(url); |
| 420 | + IRequestInfo getRequestInfo = WSDLParser.helpers.analyzeRequest(getRequest); |
| 421 | + List<String> getRequestInfoHeaders = getRequestInfo.getHeaders(); |
| 422 | + headers.set(0,getRequestInfoHeaders.get(0)); |
| 423 | + |
| 424 | + byte[] request = WSDLParser.helpers.buildHttpMessage(headers,new byte[]{}); |
418 | 425 | IHttpRequestResponse httpRequestResponse = WSDLParser.callbacks.makeHttpRequest(WSDLParser.httpRequestResponse.getHttpService(),request);
|
419 | 426 | byte[] response = httpRequestResponse.getResponse();
|
420 | 427 | IResponseInfo responseInfo = WSDLParser.helpers.analyzeResponse(response);
|
@@ -814,8 +821,13 @@ protected ExtensibilityElement parseSchema( Class parentType,
|
814 | 821 |
|
815 | 822 | if (referencedSchema == null)
|
816 | 823 | {
|
817 |
| - // We haven't read this schema in before so do it now |
818 |
| - byte[] request = WSDLParser.helpers.buildHttpMessage(WSDLParser.headers,new byte[]{}); |
| 824 | + List<String> headers = WSDLParser.headers; |
| 825 | + byte[] getRequest = WSDLParser.helpers.buildHttpRequest(url); |
| 826 | + IRequestInfo getRequestInfo = WSDLParser.helpers.analyzeRequest(getRequest); |
| 827 | + List<String> getRequestInfoHeaders = getRequestInfo.getHeaders(); |
| 828 | + headers.set(0,getRequestInfoHeaders.get(0)); |
| 829 | + |
| 830 | + byte[] request = WSDLParser.helpers.buildHttpMessage(headers,new byte[]{}); |
819 | 831 | IHttpRequestResponse httpRequestResponse = WSDLParser.callbacks.makeHttpRequest(WSDLParser.httpRequestResponse.getHttpService(),request);
|
820 | 832 | byte[] response = httpRequestResponse.getResponse();
|
821 | 833 | IResponseInfo responseInfo = WSDLParser.helpers.analyzeResponse(response);
|
@@ -2287,7 +2299,14 @@ public Definition readWSDL(String contextURI, String wsdlURI)
|
2287 | 2299 | : null;
|
2288 | 2300 | URL url = StringUtils.getURL(contextURL, wsdlURI);
|
2289 | 2301 |
|
2290 |
| - byte[] request = WSDLParser.helpers.buildHttpMessage(WSDLParser.headers,new byte[]{}); |
| 2302 | + List<String> headers = WSDLParser.headers; |
| 2303 | + byte[] getRequest = WSDLParser.helpers.buildHttpRequest(url); |
| 2304 | + IRequestInfo getRequestInfo = WSDLParser.helpers.analyzeRequest(getRequest); |
| 2305 | + List<String> getRequestInfoHeaders = getRequestInfo.getHeaders(); |
| 2306 | + headers.set(0,getRequestInfoHeaders.get(0)); |
| 2307 | + |
| 2308 | + byte[] request = WSDLParser.helpers.buildHttpMessage(headers,new byte[]{}); |
| 2309 | + |
2291 | 2310 | IHttpRequestResponse httpRequestResponse = WSDLParser.callbacks.makeHttpRequest(WSDLParser.httpRequestResponse.getHttpService(),request);
|
2292 | 2311 | byte[] response = httpRequestResponse.getResponse();
|
2293 | 2312 | IResponseInfo responseInfo = WSDLParser.helpers.analyzeResponse(response);
|
|
0 commit comments