Skip to content

Commit

Permalink
telnet: fix prompt handling for config commands
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-sahlmann committed Feb 7, 2024
1 parent d63dceb commit fb37eba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mb_netmgmt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# along with mb-netmgmt. If not, see <https://www.gnu.org/licenses/

"""Network Management Protocols for Mountebank"""
__version__ = "0.0.80"
__version__ = "0.0.81"

import os
import subprocess
Expand Down
5 changes: 3 additions & 2 deletions mb_netmgmt/telnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def handle_command(self, command, request_id):
return self.handle_request({"command": command.decode()}, request_id)

def send_upstream(self, request, request_id):
self.telnet.execute(request["command"])
self.telnet.send(request["command"])

def read_request(self):
return self.rfile.readline(), None
Expand All @@ -65,7 +65,8 @@ def respond(self, response, request_id):
self.stopped = True

def read_proxy_response(self):
return {"response": self.telnet.response}
_, match = self.telnet.expect_prompt()
return {"response": match.string}

def handle_username_prompt(self):
username_prompt = b"Username: "
Expand Down

0 comments on commit fb37eba

Please sign in to comment.