Sha256: 8efdade57e8bba9928040e70b26d9e80c6408f15f6aeb047ec50d2491682d940
Contents?: true
Size: 733 Bytes
Versions: 14
Compression:
Stored size: 733 Bytes
Contents
module Rack # Rack::Facebook formats HTTP responses to remove certain status codes # and HTML entities that are invalid as FBML responses. class Facebook def initialize(app) @_app = app end def call(env) code, headers, body = @_app.call(env) if code >= 500 && code < 600 code = 200 end contents = '' body.each {|p| contents += p } contents.gsub!(/txmt:\/\//, 'http://textmate.local/') contents.gsub!('<body>', '<div class="body">') contents.gsub!('</body>', '</div>') contents.gsub!('<wbr/>', '') headers['Content-Length'] = contents.content_length.to_s [ code, headers, contents ] end end end
Version data entries
14 entries across 14 versions & 1 rubygems