10 lines
270 B
Python
10 lines
270 B
Python
from typing import Optional
|
|
|
|
from flask_restful import abort
|
|
from pathvalidate import is_valid_filepath
|
|
|
|
|
|
def validate_url(url: Optional[str]):
|
|
if url is not None:
|
|
if not is_valid_filepath(url, platform='posix'):
|
|
abort(400, message='invalid url') |