refactor uri scheme validation

This commit is contained in:
Fabian Freund
2025-07-30 22:04:22 +02:00
parent fe1708d471
commit 6bc93f7b7d
2 changed files with 7 additions and 2 deletions
+5
View File
@@ -17,6 +17,11 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
const _supportedSchemes = {'https', 'http', 'ftp', 'file', 'content', 'about'};
extension UriX on Uri {
Uri get base => Uri.parse('$scheme://$authority');
bool get hasSupportedScheme => _supportedSchemes.contains(scheme);
}