public class

UriValidator

extends Object
java.lang.Object
   ↳ com.atlassian.jira.util.UriValidator

Class Overview

Verify that a url is not executable Needs to be instantiated to support testing - oh PowerMock wherefore art thou

Summary

Public Constructors
UriValidator(String encoding)
Public Methods
@Nullable String getSafeUri(String canonicalBaseUri, String uri)
This method returns a safe URI - it firstly URL decodes and then only allows HTTP(s) schemes
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public UriValidator (String encoding)

Public Methods

@Nullable public String getSafeUri (String canonicalBaseUri, String uri)

This method returns a safe URI - it firstly URL decodes and then only allows HTTP(s) schemes

Parameters
canonicalBaseUri The base URI - if no trailing slash one will be provided
uri The uri to resolve
Returns
  • A resolved URI, null if it is an unsuppported scheme, viz. Javascript