Browse files

so that hitting the server directly does not asplode

  • Loading branch information...
1 parent 56c2561 commit c3cf02a4e0e22d1e4031446c738889638cb266a6 @schacon schacon committed Jul 1, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 bin/djsd
View
6 bin/djsd
@@ -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 c3cf02a

Please sign in to comment.