Loading back/myfab/api.py +3 −2 Original line number Diff line number Diff line Loading @@ -707,7 +707,8 @@ def add_new_printer(): @app.route("/printers/announce/<name>/<key>") def announce_printer(name, key): cfg = json.dumps({"hostname": request.remote_addr, "port": 5000, "key": key}) ip = request.environ['REMOTE_ADDR'] if request.environ.get('HTTP_X_FORWARDED_FOR') is None else request.environ['HTTP_X_FORWARDED_FOR'] cfg = json.dumps({"hostname": ip, "port": 5000, "key": key}) log.info(f'Registring printer {name} with config {cfg}') printer = get_printer_by_name(name) if printer == None: Loading Loading
back/myfab/api.py +3 −2 Original line number Diff line number Diff line Loading @@ -707,7 +707,8 @@ def add_new_printer(): @app.route("/printers/announce/<name>/<key>") def announce_printer(name, key): cfg = json.dumps({"hostname": request.remote_addr, "port": 5000, "key": key}) ip = request.environ['REMOTE_ADDR'] if request.environ.get('HTTP_X_FORWARDED_FOR') is None else request.environ['HTTP_X_FORWARDED_FOR'] cfg = json.dumps({"hostname": ip, "port": 5000, "key": key}) log.info(f'Registring printer {name} with config {cfg}') printer = get_printer_by_name(name) if printer == None: Loading