| skipped 38 lines |
39 | 39 | | DBG = f'[{ORANGE}Debug{END}]' |
40 | 40 | | IMPORTANT = f'[{ORANGE}Important{END}]' |
41 | 41 | | FAILED = f'[{RED}Fail{END}]' |
| 42 | + | POST_DATA = f'[{PURPLE}Post-data{END}]' |
42 | 43 | | |
43 | 44 | | parser = argparse.ArgumentParser() |
44 | 45 | | parser.add_argument("-c", "--cert", action="store", help = "Your certificate.") |
| skipped 71 lines |
116 | 117 | | self.wfile.write(b'OK') |
117 | 118 | | real_action = self.headers["Action"] |
118 | 119 | | content_len = int(self.headers.get('Content-Length')) |
119 | | - | form_attrs = {'Action':self.headers.get("X-form-action"), 'Method':self.headers.get("X-form-method"), 'Enctype':self.headers.get("X-form-enctype"), 'Encoding':self.headers.get("X-form-encoding")} |
120 | 120 | | post_data = self.rfile.read(content_len) |
121 | | - | |
| 121 | + | print(f'{POST_DATA} Received from {self.client_address[0]}') |
| 122 | + | print(post_data.decode('utf-8', 'ignore').replace('<br>', '\n')) |
122 | 123 | | except: |
123 | 124 | | pass |
124 | 125 | | |
| skipped 82 lines |