-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New example of IP blocking #213
Conversation
New example of IP blocking
New example of IP blocking
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example should use the request.clientIp
property.
Is there a standard copyright that should be included on the JavaScript?
import { blockedIPs } from './ipList.js'; | ||
|
||
export async function onClientRequest(request) { | ||
const clientIP = request.getVariable('PMUSER_IP'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest using the new request.clientIp property instead of the PM variable. It will be easier to set up.
@evan-hughes, Thank you for reviewing it. I changed it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like other examples have a copyright in the main.js, e.g. the mPulse currency converter.
Please add a copyright statement in the main.js.
A copyright statement is added. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thanks for putting that together!
New example of IP blocking