Created
February 8, 2018 09:58
-
-
Save pajswigger/c805a7b9b2291fbf9660af9055bc37c6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For use with Python Scripter extension | |
from java.net import URL | |
if not messageIsRequest: | |
request_info = helpers.analyzeRequest(messageInfo.getHttpService(), messageInfo.getRequest()) | |
if request_info.getUrl().toString() == 'http://blah/': | |
response_info = helpers.analyzeResponse(messageInfo.getResponse()) | |
for header in response_info.getHeaders(): | |
if header.startswith('Location: '): | |
url = URL(header[len('Location: '):]) | |
req = helpers.buildHttpRequest(url) | |
port = url.getPort() | |
if port == -1: | |
port = url.getDefaultPort() | |
callbacks.makeHttpRequest(url.getHost(), port, url.getProtocol() == 'https', req) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment