Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 23 additions & 19 deletions AuthMatrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,25 +563,28 @@ def createMenuItems(self, invocation):



class AddRequestActionListener(ActionListener):
def __init__(self, extender):
self.extender = extender

def addRequestsToTab(e):
for messageInfo in messages:
requestInfo = self._helpers.analyzeRequest(messageInfo)
name = str(requestInfo.getMethod()).ljust(8) + requestInfo.getUrl().getPath()
# Grab regex from response
regex = "^HTTP/1\\.1 200 OK"
response = messageInfo.getResponse()
if response:
responseInfo=self._helpers.analyzeResponse(response)
if len(responseInfo.getHeaders()):
responseCodeHeader = responseInfo.getHeaders()[0]
regex = "^"+re.escape(responseCodeHeader)
# Must create a new RequestResponseStored object since modifying the original messageInfo
# from its source (such as Repeater) changes this saved object. MessageInfo is a reference, not a copy
messageIndex = self._db.createNewMessage(RequestResponseStored(self,requestResponse=messageInfo), name, regex)
self._messageTable.redrawTable()
self._chainTable.redrawTable()
self.highlightTab()
def actionPerformed(self, e):
for messageInfo in messages:
requestInfo = self.extender._helpers.analyzeRequest(messageInfo)
name = str(requestInfo.getMethod()).ljust(8) + requestInfo.getUrl().getPath()
# Grab regex from response
regex = "^HTTP/1\\.1 200 OK"
response = messageInfo.getResponse()
if response:
responseInfo=self.extender._helpers.analyzeResponse(response)
if len(responseInfo.getHeaders()):
responseCodeHeader = responseInfo.getHeaders()[0]
regex = "^"+re.escape(responseCodeHeader)
# Must create a new RequestResponseStored object since modifying the original messageInfo
# from its source (such as Repeater) changes this saved object. MessageInfo is a reference, not a copy
messageIndex = self.extender._db.createNewMessage(RequestResponseStored(self.extender,requestResponse=messageInfo), name, regex)
self.extender._messageTable.redrawTable()
self.extender._chainTable.redrawTable()
self.extender.highlightTab()


class UserCookiesActionListener(ActionListener):
Expand Down Expand Up @@ -623,7 +626,8 @@ def actionPerformed(self, e):

if valid:
menuItem = JMenuItem("Send request(s) to AuthMatrix");
menuItem.addActionListener(addRequestsToTab)
menuItem.addActionListener(AddRequestActionListener(self))

ret.append(menuItem)

if len(messages)==1:
Expand Down