mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-12 16:35:45 +01:00
Fix loading plugin resources without context path
When the context path is set to '/', we get an empty context path. Nonetheless the URL has to start with a '/'. So we have to add it explicitly, here.
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
package sonia.scm.api.v2.resources;
|
||||
|
||||
import com.google.common.base.Strings;
|
||||
@@ -77,7 +77,7 @@ public class UIPluginDtoMapper {
|
||||
private String addContextPath(String resource) {
|
||||
String ctxPath = request.getContextPath();
|
||||
if (Strings.isNullOrEmpty(ctxPath)) {
|
||||
return resource;
|
||||
return "/" + resource;
|
||||
}
|
||||
return HttpUtil.append(ctxPath, resource);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user