Skip to content

Commit

Permalink
Path on windows platform (#440)
Browse files Browse the repository at this point in the history
* Path on windows platform

URL double encoding in Chrome

These changes fix the issue reported in #394 
The solution was to change the paths to be system independent.
Tested in windows and unix platforms

---------

Co-authored-by: Gyuri Boros <[email protected]>
  • Loading branch information
gyurib and Gyuri Boros authored Jul 25, 2024
1 parent e8f6d16 commit d57e60a
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.zalando.intellij.swagger.service;

import com.intellij.openapi.util.io.FileUtilRt;
import com.intellij.util.Url;
import com.intellij.util.Urls;
import java.io.File;
Expand All @@ -9,7 +10,9 @@
public class SwaggerFilesUtils {

public static Url convertSwaggerLocationToUrl(@NotNull final Path swaggerHtmlDirectory) {
return Urls.newUri("file", swaggerHtmlDirectory + File.separator + "index.html");
return Urls.newUri(
"file",
FileUtilRt.toSystemIndependentName(swaggerHtmlDirectory + File.separator + "index.html"));
}

public static boolean isFileReference(final String text) {
Expand Down

0 comments on commit d57e60a

Please sign in to comment.