Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class RestrictIP
- def initialize(app, message = "Hello")
- @app = app
- @message = message
- end
- def call(env)
- dup._call(env)
- @ip = env['HTTP_X_REAL_IP'] ||= env['REMOTE_ADDR']
- end
- def each(&block)
- block.call("<!-- #{@ip} -->n")
- @response.each(&block)
- end
- end
- NoMethodError (You have a nil object when you didn't expect it!
- You might have expected an instance of Array.
- The error occurred while evaluating nil.[]=):
Add Comment
Please, Sign In to add comment