jlong / serve

Serve is a small Rack-based web server and rapid prototyping framework for Web applications (specifically Rails apps). Serve is meant to be a lightweight version of the Views part of the Rails MVC. This makes Serve an ideal framework for prototyping Rails applications or creating simple websites. Serve has full support for Rails-style partials and layouts.
http://get-serve.com
Other
836 stars 90 forks source link

Redirect content attribute #102

Closed gusgollings closed 9 years ago

gusgollings commented 11 years ago

The diff below suggests a change to add the url= to the content attribute of the refresh. This should work better across all browsers as this way it conforms to the HTML spec.

diff --git a/lib/serve/export.rb b/lib/serve/export.rb
index 98ab8cd..ab41264 100644
--- a/lib/serve/export.rb
+++ b/lib/serve/export.rb
@@ -93,8 +93,8 @@ module Serve

         lines = IO.read(from_path).strip.split("\n")
         url = lines.pop.strip
-        contents = %{<html><head><meta http-equiv="refresh" content="0;#{url}" /></head></html>}
+        contents = %{<html><head><meta http-equiv="refresh" content="0; url=#{url}" /></head></html>}

         File.open(to_path, 'w+') { |f| f.puts contents }

         log_action "compiled", to_path