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 crash handling a request for a directory #108

Merged
merged 1 commit into from
May 21, 2014
Merged

Fix crash handling a request for a directory #108

merged 1 commit into from
May 21, 2014

Conversation

isotes
Copy link
Contributor

@isotes isotes commented May 20, 2014

When there is a request for an existing directory, the tool tries to serve this as a file which results in an exception: ... in 'send_file_data': : 1 Is a directory (IOError)

The pull request adds a check for this.

@@ -10,13 +10,13 @@ class WebSocket < EventMachine::WebSocket::Connection
def dispatch(data)
parser = Http::Parser.new
parser << data
request_path = URI.parse(parser.request_url).path
request_path = '.' + URI.parse(parser.request_url).path # prepend with '.' to make it usable as a file path

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [116/80]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I fix this? (other lines in the file have the same length - so I don't know if this is preferred)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add the comment on a new line before? Thanks!

@isotes
Copy link
Contributor Author

isotes commented May 21, 2014

I fixed the comment and (hopefully, still rather new to this) squashed it in the commit

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 7247fbf on isotes:fix-crash-directory-request into e016d77 on guard:master.

@thibaudgg
Copy link
Member

+:1+

thibaudgg added a commit that referenced this pull request May 21, 2014
Fix crash handling a request for a directory
@thibaudgg thibaudgg merged commit 49c2d5b into guard:master May 21, 2014
@isotes isotes deleted the fix-crash-directory-request branch May 21, 2014 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants