d24989cdda816343f74a97fc32ce3fd1a689a265,lib/streamlit/Server.py,,_is_url_from_allowed_origins,#Any#,400
Before Change
hostname = urllib.parse.urlparse(url).hostname
// Allow connections from bucket.
if hostname == config.get_option("s3.bucket"):
return True
// Allow connections from watcher"s machine or localhost.
allowed_domains = [
"localhost",
"127.0.0.1",
util.get_internal_ip(),
util.get_external_ip(),
]
s3_url = config.get_option("s3.url")
if s3_url is not None:
parsed = urllib.parse.urlparse(s3_url)
allowed_domains.append(parsed.hostname)
if config.is_manually_set("browser.serverAddress"):
allowed_domains.append(config.get_option("browser.serverAddress"))
return any(hostname == d for d in allowed_domains)
After Change
if hostname == allowed_domain:
return True
return False
def _get_server_address_if_manually_set():
if config.is_manually_set("browser.serverAddress"):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: streamlit/streamlit
Commit Name: d24989cdda816343f74a97fc32ce3fd1a689a265
Time: 2019-07-16
Author: thiago@streamlit.io
File Name: lib/streamlit/Server.py
Class Name:
Method Name: _is_url_from_allowed_origins
Project Name: streamlit/streamlit
Commit Name: c786913462decebc4157ac3e8d2ec08303021adc
Time: 2018-07-02
Author: adrien.g.treuille@gmail.com
File Name: lib/streamlit/config.py
Class Name:
Method Name: get_s3_option
Project Name: streamlit/streamlit
Commit Name: cf2e5c02c448c6f25136a4cd1b89e7f0ba1a3d37
Time: 2018-07-06
Author: adrien.g.treuille@gmail.com
File Name: lib/streamlit/config.py
Class Name:
Method Name: get_s3_option