We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9aea269 commit 3b98f47Copy full SHA for 3b98f47
spotify_api/src/api_model/credentials.rs
@@ -67,8 +67,15 @@ pub mod Code {
67
68
auth_code = value.to_string();
69
}
70
-
71
- let message = "OK";
+
+ // This html closes the tab itself automatically.
72
+ let message: String = vec![
73
+ "<!DOCTYPE html>",
74
+ "<html>",
75
+ "<body onload=\"open(location, '_self').close();\">",
76
+ "</body>",
77
+ "</html>"
78
+ ].concat();
79
let response = format!{"HTTP/1.1 OK\rcontent_length: {}\r\n\r\n{}", message.len(), message};
80
stream.write_all(response.as_bytes()).unwrap();
81
break;
0 commit comments