Skip to content

properly join URLs #2375

@spaetz

Description

@spaetz

Describe the bug
if baseurls don't have a final slash, the function getCacheApiUrl constructs invalid URLS

Details
My CI runner baseurl is https://forgejo.ellis.link, however, CI jobs try to access
https://forgejo.ellis.link_apis/artifactcache/... (note the missing slash after the domain name)

The reason is here which does:

  const url = `${baseUrl}_apis/artifactcache/${resource}`

Would it be possible to use a proper URL mangling function, eg.https://docs.rs/url/latest/url/struct.Url.html#method.join to handle cases both with final slash and without?

baseURL is very fragile as it is right now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions