Skip to content

Commit

Permalink
Fix the problem of resolving logo starting with slash (#5256)
Browse files Browse the repository at this point in the history
#### What type of PR is this?

/kind bug
/area core
/milestone 2.12.x

#### What this PR does / why we need it:

This PR treats logo as a path when building logo HTTP URL instead of a path segment. The concrete rules of logo is described [here](#5253 (comment)).

See #5253 for more.

#### Which issue(s) this PR fixes:

Fixes #5253

#### Does this PR introduce a user-facing change?

```release-note
None
```
  • Loading branch information
JohnNiang authored Jan 26, 2024
1 parent 8288e4e commit 1be470a
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ private void resolveStaticResources(Plugin plugin) {
log.info("Resolving logo resource for plugin {}", pluginName);
// the logo might be:
// 1. URL
// 2. file name
// 2. relative path to "resources" folder
// 3. base64 format data image
var logo = specLogo;
if (!specLogo.startsWith("data:image")) {
Expand All @@ -249,7 +249,8 @@ private void resolveStaticResources(Plugin plugin) {
} catch (MalformedURLException ignored) {
// indicate the logo is a path
logo = UriComponentsBuilder.newInstance()
.pathSegment("plugins", pluginName, "assets", specLogo)
.pathSegment("plugins", pluginName, "assets")
.path(specLogo)
.queryParam("version", pluginVersion)
.build(true)
.toString();
Expand Down

0 comments on commit 1be470a

Please sign in to comment.