From bd005752198ed83935d4ace44f0cb7d33f5b5807 Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Mon, 18 Feb 2019 13:07:51 +0300 Subject: [PATCH] IDEA: fix dev server run configuration on Windows. Fix CORS issue with stack trace deobfuscator --- .../src/main/java/org/teavm/devserver/CodeServlet.java | 1 + .../src/main/java/org/teavm/idea/devserver/DevServerRunner.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/devserver/src/main/java/org/teavm/devserver/CodeServlet.java b/tools/devserver/src/main/java/org/teavm/devserver/CodeServlet.java index ee2db3d87..aaab7b338 100644 --- a/tools/devserver/src/main/java/org/teavm/devserver/CodeServlet.java +++ b/tools/devserver/src/main/java/org/teavm/devserver/CodeServlet.java @@ -324,6 +324,7 @@ public class CodeServlet extends HttpServlet { if (fileContent != null) { resp.setStatus(HttpServletResponse.SC_OK); resp.setCharacterEncoding("UTF-8"); + resp.setHeader("Access-Control-Allow-Origin", "*"); resp.setContentType("text/plain"); resp.getOutputStream().write(fileContent); resp.getOutputStream().flush(); diff --git a/tools/idea/plugin/src/main/java/org/teavm/idea/devserver/DevServerRunner.java b/tools/idea/plugin/src/main/java/org/teavm/idea/devserver/DevServerRunner.java index 4fdb44dac..843427e01 100644 --- a/tools/idea/plugin/src/main/java/org/teavm/idea/devserver/DevServerRunner.java +++ b/tools/idea/plugin/src/main/java/org/teavm/idea/devserver/DevServerRunner.java @@ -212,7 +212,7 @@ public class DevServerRunner extends UnicastRemoteObject implements DevServerMan arguments.add("-proxy-url"); arguments.add(options.proxyUrl); } - if (options.proxyPath != null) { + if (options.proxyPath != null && !options.proxyPath.isEmpty()) { arguments.add("-proxy-path"); arguments.add(options.proxyPath); }