class ThriftRack::FormatCheck

Public Class Methods

new(app) click to toggle source
# File lib/thrift_rack/format_check.rb, line 3
def initialize(app)
  @app = app
end

Public Instance Methods

call(env) click to toggle source
# File lib/thrift_rack/format_check.rb, line 7
def call(env)
  req = Rack::Request.new(env)
  return 400, {'Content-Type' => 'text/plain'}, ["Not Valid Thrift Request"] unless req.post? && req.env["CONTENT_TYPE"] == THRIFT_HEADER
  @app.call(env)
end