Add API security and async job contracts
This commit is contained in:
@@ -29,6 +29,7 @@ import sys
|
||||
import re
|
||||
import glob
|
||||
import argparse
|
||||
from urllib.parse import urlparse
|
||||
|
||||
try:
|
||||
import markdown
|
||||
@@ -323,6 +324,13 @@ def build_cover(name, lagna, gender, status, pkg, desc, lang="cn"):
|
||||
</div>"""
|
||||
|
||||
|
||||
def is_allowed_report_resource_url(url, *, report_url):
|
||||
if url == report_url:
|
||||
return True
|
||||
parsed = urlparse(url)
|
||||
return parsed.scheme in {'data', 'about', 'blob'}
|
||||
|
||||
|
||||
def build_toc(sections, lang="cn"):
|
||||
"""Generate table of contents HTML."""
|
||||
toc_title = "目录" if lang == "cn" else "Table of Contents"
|
||||
|
||||
Reference in New Issue
Block a user