Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@glints/hapi-real-ip-plugin

Package Overview
Dependencies
Maintainers
4
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@glints/hapi-real-ip-plugin - npm Package Compare versions

Comparing version 3.0.0 to 3.0.1

5

dist/index.js

@@ -1,2 +0,5 @@

export { default as RealIPPlugin, } from './RealIPPlugin';
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var RealIPPlugin_1 = require("./RealIPPlugin");
exports.RealIPPlugin = RealIPPlugin_1.default;
//# sourceMappingURL=index.js.map

4

dist/RealIPPlugin.js

@@ -0,1 +1,3 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const RealIPPlugin = {

@@ -21,3 +23,3 @@ name: 'RealIPPlugin',

};
export default RealIPPlugin;
exports.default = RealIPPlugin;
//# sourceMappingURL=RealIPPlugin.js.map

@@ -1,6 +0,8 @@

import 'mocha';
import { assert } from 'chai';
import * as Sinon from 'sinon';
import * as Hapi from '@hapi/hapi';
import RealIPPlugin from './RealIPPlugin';
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
require("mocha");
const chai_1 = require("chai");
const Sinon = require("sinon");
const Hapi = require("@hapi/hapi");
const RealIPPlugin_1 = require("./RealIPPlugin");
describe('RealIPPlugin', () => {

@@ -24,8 +26,8 @@ let server;

it('should be registered', async () => {
await server.register({ plugin: RealIPPlugin });
assert.exists(server.registrations[RealIPPlugin.name]);
await server.register({ plugin: RealIPPlugin_1.default });
chai_1.assert.exists(server.registrations[RealIPPlugin_1.default.name]);
});
describe('Plugin Functionality', () => {
it('should pass address as-is without X-Forwarded-For header', async () => {
await server.register({ plugin: RealIPPlugin });
await server.register({ plugin: RealIPPlugin_1.default });
await server.inject({

@@ -36,7 +38,7 @@ url: '/',

const request = spy.args[0][0];
assert.strictEqual(request.info.remoteAddress, '1.2.3.4');
chai_1.assert.strictEqual(request.info.remoteAddress, '1.2.3.4');
});
it('should set request.info.remoteAddress with X-Forwarded-For header', async () => {
await server.register({
plugin: RealIPPlugin,
plugin: RealIPPlugin_1.default,
options: {

@@ -54,7 +56,7 @@ numProxies: 1,

const request = spy.args[0][0];
assert.strictEqual(request.info.remoteAddress, '2.3.4.5');
chai_1.assert.strictEqual(request.info.remoteAddress, '2.3.4.5');
});
it('should handle multiple headers', async () => {
await server.register({
plugin: RealIPPlugin,
plugin: RealIPPlugin_1.default,
options: {

@@ -72,3 +74,3 @@ numProxies: 2,

const request = spy.args[0][0];
assert.strictEqual(request.info.remoteAddress, '3.4.5.6');
chai_1.assert.strictEqual(request.info.remoteAddress, '3.4.5.6');
});

@@ -75,0 +77,0 @@ });

{
"name": "@glints/hapi-real-ip-plugin",
"version": "3.0.0",
"version": "3.0.1",
"description": "A plugin that attempts to determine the real IP of the client.",

@@ -5,0 +5,0 @@ "main": "./dist/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc