Permalink
Browse files

use proper links to images on error pages

  • Loading branch information...
1 parent f2b494b commit fe9a77dcd38fff925e11b1fdc5dd8ceae2890443 @rkh rkh committed Apr 8, 2011
Showing with 5 additions and 2 deletions.
  1. +3 −0 CHANGES
  2. +1 −1 lib/sinatra/base.rb
  3. +1 −1 lib/sinatra/showexceptions.rb
View
3 CHANGES
@@ -23,6 +23,9 @@
* If a route with an empty pattern is defined (`get("") { ... }`) requests with
an empty path info match this route instead of "/". (Konstantin Haase)
+ * In development environment, when running under a nested path, the image URIs
+ on the error pages are set properly. (Konstantin Haase)
+
= 1.2.1 / 2011-03-17
* Use a generated session secret when using `enable :sessions`. (Konstantin
View
2 lib/sinatra/base.rb
@@ -1439,7 +1439,7 @@ class << self
</head>
<body>
<h2>Sinatra doesn't know this ditty.</h2>
- <img src='/__sinatra__/404.png'>
+ <img src='#{uri "/__sinatra__/404.png"}'>
<div id="c">
Try this:
<pre>#{request.request_method.downcase} '#{request.path_info}' do\n "Hello World"\nend</pre>
View
2 lib/sinatra/showexceptions.rb
@@ -174,7 +174,7 @@ def frame_class(frame)
<body>
<div id="wrap">
<div id="header">
- <img src="/__sinatra__/500.png" alt="application error" height="161" width="313" />
+ <img src="<%= env['SCRIPT_NAME'] %>/__sinatra__/500.png" alt="application error" height="161" width="313" />
<div id="summary">
<h1><strong><%=h exception.class %></strong> at <strong><%=h path %>
</strong></h1>

0 comments on commit fe9a77d

Please sign in to comment.