Permalink
Browse files

Merge pull request #33 from schacon/serverfix

so that hitting the server directly does not asplode
  • Loading branch information...
2 parents 0462a3e + c3cf02a commit ecaccc382c2a978ce2c8a5fc447df4adedac3ab5 @defunkt defunkt committed Jul 2, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 bin/djsd
View
@@ -18,9 +18,9 @@ dotjs = Class.new(WEBrick::HTTPServlet::AbstractServlet) do
file = File.expand_path("#{request.path.gsub('/','')}")
default = File.expand_path("default.js")
- body = ''
- body << File.read(default) + "\n" if File.exists?(default)
- body << File.read(file) if File.exists?(file)
+ body = "// dotjs is working! //\n"
+ body << File.read(default) + "\n" if File.file?(default)
+ body << File.read(file) if File.file?(file)
response.status = body.empty? ? 204 : 200
response['Access-Control-Allow-Origin'] = '*'

0 comments on commit ecaccc3

Please sign in to comment.