Skip to content

Commit 2566e1a

Browse files
committed
Correctly handle spaces/special characters in JAR path
Without this, we fail to correctly find our own JAR location, which means we fail to self-test or attach.
1 parent b082269 commit 2566e1a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/kotlin/tech/httptoolkit/javaagent/AttachMain.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ fun attachAgent(
8585
) {
8686
val jarPath = File(
8787
ConstantProxySelector::class.java // Any arbitrary class defined inside this JAR
88-
.protectionDomain.codeSource.location.path
88+
.protectionDomain.codeSource.location.toURI()
8989
).absolutePath
9090

9191
// Inject the agent into the target VM

0 commit comments

Comments
 (0)