package com.google.musicanalysis.site;
import java.io.IOException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/** 
 * New page after logging in via oauth. This servlet closes the page.
 */
@WebServlet("/api/oauth/landing")
public class OAuthLandingServlet extends HttpServlet {
  @Override
  public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException {
    res.setContentType("text/html");

    StringBuilder content = new StringBuilder();
    content.append("<html><body>Succesfully Logged in.<script type=\"text/javascript\">");
    content.append("window.close();");
    content.append("</script></body></html>");

    res.getWriter().write(content.toString());
    res.setStatus(200);
  }
}

@@ -555,23 +555,16 @@
   String
-Builder
  content
@@ -570,55 +570,39 @@
 t = 
-new StringBuilder();%0A    content.append(%22%3Chtml%3E
+%22%3Chtml%3E%22%0A                   + %22
 %3Cbod
@@ -613,15 +613,16 @@
 cces
+s
 fully 
-L
+l
 ogge
@@ -627,16 +627,47 @@
 ged in.%3C
+/body%3E%22%0A                   + %22%3C
 script t
@@ -694,95 +694,64 @@
 t%5C%22%3E
-%22);%0A    content.append(%22window.close();%22);%0A    content.append(%22%3C/script%3E%3C/body%3E
+window.close();%3C/script%3E%22%0A                   + %22
 %3C/html%3E%22
 );%0A%0A
@@ -746,17 +746,16 @@
 %3C/html%3E%22
-)
 ;%0A%0A    r
@@ -786,19 +786,8 @@
 tent
-.toString()
 );%0A 

remove stringbuilder