Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error when snapshot response is missing content-type header #805

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion octoprint_octolapse/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ def _test_web_camera(camera_profile, timeout_seconds=2, is_before_print_test=Fal
message = "The request contained no data for the '{0}' camera profile.".format(camera_profile.name)
logger.error(message)
raise CameraError('request-contained-no-data', message)
elif "image/jpeg" not in r.headers["content-type"].lower():
elif 'content-type' in r.headers and "image/jpeg" not in r.headers["content-type"].lower():
message = (
"The returned data was not an image for the '{0}' camera profile.".format(camera_profile.name)
)
Expand Down