title: HTTP redirect does not work in every browser
body: <p>I am running an HTTP-Server with a <code>ServerSocket</code> and listening for <code>Socket's</code> that the server accepts. I want to redirect to an external site depending the request. So far I parse the request and write the response into the <code>OutputStream</code> of the client <code>Socket</code>.
  Running the following example code:</p>
  <pre><code>OutputStream os = clientSocket.getOutputStream();
  os.write(&quot;HTTP/1.1 301 Moved Permanently\r\n&quot;.getBytes());
  os.write(&quot;Location: http://www.google.com/\r\n&quot;.getBytes());
  os.write(&quot;\r\n\r\n&quot;.getBytes());
  os.flush();
  clientSocket.close();
  </code></pre>
  <p>The redirection to <code>google.com</code> works in firefox but in brave browser it opens a new browser window (without actually navigating to the site) after notifying me with &quot;Open xdg-open? A website wants to open this application&quot;. I am running the browser on Arch Linux. How can I make it work for brave browser as well?</p>