Enable CORS by default, which is necessary for AJAX resolver to run
Enable CORS by default, which is necessary for AJAX resolver to run

--- a/doh-server/server.go
+++ b/doh-server/server.go
@@ -108,8 +108,17 @@
 func (s *Server) handlerFunc(w http.ResponseWriter, r *http.Request) {
 	ctx := r.Context()
 
+	w.Header().Set("Access-Control-Allow-Headers", "Content-Type")
+	w.Header().Set("Access-Control-Allow-Methods", "GET, HEAD, OPTIONS, POST")
+	w.Header().Set("Access-Control-Allow-Origin", "*")
+	w.Header().Set("Access-Control-Max-Age", "3600")
 	w.Header().Set("Server", USER_AGENT)
 	w.Header().Set("X-Powered-By", USER_AGENT)
+
+	if r.Method == "OPTIONS" {
+		w.Header().Set("Content-Length", "0")
+		return
+	}
 
 	if r.Form == nil {
 		const maxMemory = 32 << 20 // 32 MB