Skip to content

Commit

Permalink
Improve path segment escaping in OciRepositoryHandler:
Browse files Browse the repository at this point in the history
old:
/ -> $1
$ -> $0
new: optimizes for nice escaping of slashes that are almost always part of the registryUrl and imageName, while '*' is less common
/ -> *
* -> $1
$ -> $0
  • Loading branch information
SgtSilvio committed Jul 16, 2024
1 parent e92f334 commit e1e5a4a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,6 @@ private fun JsonArrayStringBuilder.addDependency(
addCapabilities("requestedCapabilities", capabilities, platform)
}

internal fun String.escapePathSegment() = escapeReplace('/', '$')
internal fun String.escapePathSegment() = escapeReplace('*', '$').replace('/', '*')

internal fun String.unescapePathSegment() = unescapeReplace('/', '$')
internal fun String.unescapePathSegment() = replace('*', '/').unescapeReplace('*', '$')

0 comments on commit e1e5a4a

Please sign in to comment.