Skip to content

Commit d063225

Browse files
author
Vishnu Mohan
committed
Cleanup replace code
1 parent ab21bd5 commit d063225

File tree

2 files changed

+2
-21
lines changed

2 files changed

+2
-21
lines changed

jupyter_spark_history_dcos/handlers.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ def initialize(self, spark_history):
1414
@tornado.web.asynchronous
1515
def get(self):
1616
"""
17-
Fetch the requested URI from the Spark History Server, replace the
18-
URLs in the response content for HTML responses or return
19-
the verbatim response.
17+
Fetch the requested URI from the Spark History Server
2018
"""
2119
http = httpclient.AsyncHTTPClient()
2220
url = self.spark_history.backend_url(self.request)

jupyter_spark_history_dcos/spark_history.py

+1-18
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class SparkHistory(LoggingConfigurable):
3434
).tag(config=True)
3535

3636
proxy_root = Unicode(
37-
'/sparkhistory',
37+
'/sparkhistory/',
3838
help='The URL path under which the Spark History will be proxied',
3939
)
4040

@@ -46,20 +46,3 @@ def __init__(self, *args, **kwargs):
4646
def backend_url(self, request):
4747
request_path = request.uri[len(self.proxy_url):]
4848
return url_path_join(self.url, request_path)
49-
50-
def replace(self, content):
51-
"""
52-
Replace all the links with our prefixed handler links, e.g.:
53-
54-
/static/styles.css
55-
56-
with
57-
58-
/sparkhistory/static/styles.css
59-
"""
60-
soup = BeautifulSoup(content, BEAUTIFULSOUP_BUILDER)
61-
for tags, attribute in PROXY_ATTRIBUTES:
62-
for tag in soup.find_all(tags, **{attribute: True}):
63-
value = tag[attribute]
64-
tag[attribute] = url_path_join(self.base_url, value)
65-
return str(soup)

0 commit comments

Comments
 (0)