Skip to content

Commit 1a98c53

Browse files
authored
Merge pull request #4489 from pczekaj/fix-wrong-content-type
Fix invalid mime type in Jetbrains IDE
2 parents c109a4e + 9404e00 commit 1a98c53

File tree

1 file changed

+4
-1
lines changed
  • extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/factories

1 file changed

+4
-1
lines changed

extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/factories/CustomhandlerFactory.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,10 @@ class OpenedConnection(private val connection: URLConnection?) :
111111
) {
112112
try {
113113
if (connection != null) {
114-
val url = connection.url.toString()
114+
val fullUrl = connection.url.toString()
115+
// Extract only the resource path after the JAR prefix to prevent incorrect mime type matching
116+
// (e.g., if a user's home folder contains "js" in the path)
117+
val url = fullUrl.substringAfterLast("jar!/", fullUrl)
115118
when {
116119
url.contains("css") -> cefResponse.mimeType = "text/css"
117120
url.contains("js") -> cefResponse.mimeType = "text/javascript"

0 commit comments

Comments
 (0)