def do_GET(self):
if self.path.startswith(args.serve_url):<EOL><INDENT>res = None<EOL>log_res = None<EOL>mode = None<EOL>params = urllib.parse.parse_qs(self.path[len(args.serve_url):])<EOL>if "<STR_LIT>" in params:<EOL><INDENT>if args.mode_short_otp:<EOL><INDENT>mode = '<STR_LIT>'<EOL>res = validate_yubikey_otp_short(self, params)<EOL><DEDENT>elif args.mode_otp:<EOL><INDENT>mode = '<STR_LIT>'<EOL>res = validate_yubikey_otp(self, params)<EOL>log_res = '<STR_LIT:&>'.join(res.split('<STR_LIT:\n>'))<EOL><DEDENT>else:<EOL><INDENT>res = "<STR_LIT>"<EOL><DEDENT><DEDENT>elif "<STR_LIT>" in params:<EOL><INDENT>if args.mode_hotp:<EOL><INDENT>mode = '<STR_LIT>'<EOL>res = validate_oath_hotp(self, params)<EOL><DEDENT>else:<EOL><INDENT>res = "<STR_LIT>"<EOL><DEDENT><DEDENT>elif "<STR_LIT>" in params:<EOL><INDENT>if args.mode_totp:<EOL><INDENT>mode = '<STR_LIT>'<EOL>res = validate_oath_totp(self, params)<EOL><DEDENT>else:<EOL><INDENT>res = "<STR_LIT>"<EOL><DEDENT><DEDENT>elif "<STR_LIT>" in params:<EOL><INDENT>if args.mode_pwhash:<EOL><INDENT>mode = '<STR_LIT>'<EOL>res = validate_pwhash(self, params)<EOL><DEDENT>else:<EOL><INDENT>res = "<STR_LIT>"<EOL><DEDENT><DEDENT>if not log_res:<EOL><INDENT>log_res = res<EOL><DEDENT>self.log_message("<STR_LIT>", mode, self.path, log_res)<EOL>if res != None:<EOL><INDENT>self.send_response(<NUM_LIT:200>)<EOL>self.send_header('<STR_LIT>', '<STR_LIT>')<EOL>self.end_headers()<EOL>self.wfile.write(res)<EOL>self.wfile.write("<STR_LIT:\n>")<EOL><DEDENT>else:<EOL><INDENT>self.log_error ("<STR_LIT>" % (self.path))<EOL>self.send_response(<NUM_LIT>, '<STR_LIT>')<EOL>self.end_headers()<EOL><DEDENT><DEDENT>else:<EOL><INDENT>self.log_error ("<STR_LIT>" % (self.path, args.serve_url))<EOL>self.send_response(<NUM_LIT>, '<STR_LIT>')<EOL>self.end_headers()<EOL><DEDENT>
Process validation GET requests.

All modes of validation (OTP, OATH and PWHASH) must be explicitly
enabled in `args' to be allowed.