class Lucky::RemoteIpHandler

Overview

Sets the HTTP::Request#remote_address value to the value of the first IP in the X-Forwarded-For header, or fallback to the default remote_address. https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For

This Handler does a best guess for the IP which is generally good enough. If you require IP based Authentication, then you may want to handle this on your own as there will be edge cases when related to mobile clients on the go, and potential IP spoofing attacks.

Included Modules

Defined in:

lucky/remote_ip_handler.cr

Instance Method Summary

Instance Method Detail

def call(context) #

[View source]