SimpleChatTC:SimpleProxy: Include a sample config file
with allowed domains set to few sites in general to show its use this includes some sites which allow search to be carried out through them as well as provide news aggregation
This commit is contained in:
parent
370326b1ec
commit
840cab0b1c
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"allowed.domains": [
|
||||
"^www\\.bing\\.com$",
|
||||
".*\\.yahoo\\.com$",
|
||||
"^search\\.yahoo\\.com$",
|
||||
".*\\.brave\\.com$",
|
||||
"^search\\.brave\\.com$",
|
||||
".*\\.duckduckgo\\.com$",
|
||||
".*\\.google\\.com$",
|
||||
"^google\\.com$"
|
||||
]
|
||||
}
|
||||
|
|
@ -108,6 +108,7 @@ def validate_url(url: str, tag: str):
|
|||
Implement a re based filter logic on the specified url.
|
||||
"""
|
||||
urlParts = urllib.parse.urlparse(url)
|
||||
print(f"DBUG:ValidateUrl:{urlParts}, {urlParts.hostname}")
|
||||
urlHName = urlParts.hostname
|
||||
if not urlHName:
|
||||
return UrlReqResp(False, 400, f"WARN:{tag}:Missing hostname in Url")
|
||||
|
|
|
|||
Loading…
Reference in New Issue