Guest User

Untitled

a guest
Jul 20th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. class RestrictIP
  2. def initialize(app, message = "Hello")
  3. @app = app
  4. @message = message
  5. end
  6.  
  7. def call(env)
  8. dup._call(env)
  9. @ip = env['HTTP_X_REAL_IP'] ||= env['REMOTE_ADDR']
  10. end
  11.  
  12. def each(&block)
  13. block.call("<!-- #{@ip} -->n")
  14. @response.each(&block)
  15. end
  16. end
  17.  
  18. NoMethodError (You have a nil object when you didn't expect it!
  19. You might have expected an instance of Array.
  20. The error occurred while evaluating nil.[]=):
Add Comment
Please, Sign In to add comment