Skip to content

Commit

Permalink
Strip whitespaces from stream and snapshot urls
Browse files Browse the repository at this point in the history
  • Loading branch information
kennethjiang committed Oct 4, 2018
1 parent c0c2043 commit 05c8b6b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions octoprint_anywhere/mjpeg_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def next(self):
@backoff.on_exception(backoff.expo, Exception)
@backoff.on_predicate(backoff.fibo)
def capture_mjpeg(settings, q):
snapshot_url = settings.get("snapshot", None)
snapshot_url = settings.get("snapshot", None).strip()
if snapshot_url:
if not urlparse(snapshot_url).scheme:
snapshot_url = "http://localhost/" + re.sub(r"^\/", "", snapshot_url)
Expand All @@ -76,7 +76,7 @@ def capture_mjpeg(settings, q):
q.put(data)

else:
stream_url = settings.get("stream", "/webcam/?action=stream")
stream_url = settings.get("stream", "/webcam/?action=stream").strip()
if not urlparse(stream_url).scheme:
stream_url = "http://localhost/" + re.sub(r"^\/", "", stream_url)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
plugin_name = "OctoPrint Anywhere"

# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module
plugin_version = "0.8.4"
plugin_version = "0.8.5"

# The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin
# module
Expand Down

0 comments on commit 05c8b6b

Please sign in to comment.