[Pkg-javascript-commits] [node-proxy-addr] 05/10: Bundle forwarded module as a patch

Leo Iannacone l3on-guest at moszumanska.debian.org
Sun Oct 12 00:34:51 UTC 2014


This is an automated email from the git hooks/post-receive script.

l3on-guest pushed a commit to branch master
in repository node-proxy-addr.

commit 84ffa6158f094953579e7269a1b18cd1dbf0d6b0
Author: Leo Iannacone <l3on at ubuntu.com>
Date:   Sun Oct 12 02:15:51 2014 +0200

    Bundle forwarded module as a patch
---
 debian/patches/0000-bundle_forwarded.patch | 225 +++++++++++++++++++++++++++++
 debian/patches/series                      |   1 +
 2 files changed, 226 insertions(+)

diff --git a/debian/patches/0000-bundle_forwarded.patch b/debian/patches/0000-bundle_forwarded.patch
new file mode 100644
index 0000000..21fc480
--- /dev/null
+++ b/debian/patches/0000-bundle_forwarded.patch
@@ -0,0 +1,225 @@
+Description: Bundle forwarded module as patch since it only
+ reverse depends on proxy-addr module.
+Author: Leo Iannacone <l3on at ubutnu.com>
+Forwarded: not-needed
+
+--- /dev/null
++++ node-proxy-addr-1.0.3/node_modules/forwarded/.travis.yml
+@@ -0,0 +1,15 @@
++language: node_js
++node_js:
++  - "0.6"
++  - "0.8"
++  - "0.10"
++  - "0.11"
++matrix:
++  allow_failures:
++    - node_js: "0.11"
++  fast_finish: true
++script:
++  - "test $TRAVIS_NODE_VERSION != '0.6' || npm test"
++  - "test $TRAVIS_NODE_VERSION  = '0.6' || npm run-script test-travis"
++after_script:
++  - "test $TRAVIS_NODE_VERSION = '0.10' && npm install coveralls at 2 && cat ./coverage/lcov.info | coveralls"
+--- /dev/null
++++ node-proxy-addr-1.0.3/node_modules/forwarded/HISTORY.md
+@@ -0,0 +1,4 @@
++0.1.0 / 2014-09-21
++==================
++
++  * Initial release
+--- /dev/null
++++ node-proxy-addr-1.0.3/node_modules/forwarded/LICENSE
+@@ -0,0 +1,22 @@
++(The MIT License)
++
++Copyright (c) 2014 Douglas Christopher Wilson
++
++Permission is hereby granted, free of charge, to any person obtaining
++a copy of this software and associated documentation files (the
++'Software'), to deal in the Software without restriction, including
++without limitation the rights to use, copy, modify, merge, publish,
++distribute, sublicense, and/or sell copies of the Software, and to
++permit persons to whom the Software is furnished to do so, subject to
++the following conditions:
++
++The above copyright notice and this permission notice shall be
++included in all copies or substantial portions of the Software.
++
++THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
++IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
++CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
++TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
++SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+--- /dev/null
++++ node-proxy-addr-1.0.3/node_modules/forwarded/README.md
+@@ -0,0 +1,53 @@
++# forwarded
++
++[![NPM Version][npm-image]][npm-url]
++[![NPM Downloads][downloads-image]][downloads-url]
++[![Node.js Version][node-version-image]][node-version-url]
++[![Build Status][travis-image]][travis-url]
++[![Test Coverage][coveralls-image]][coveralls-url]
++
++Parse HTTP X-Forwarded-For header
++
++## Installation
++
++```sh
++$ npm install forwarded
++```
++
++## API
++
++```js
++var forwarded = require('forwarded')
++```
++
++### forwarded(req)
++
++```js
++var addresses = forwarded(req)
++```
++
++Parse the `X-Forwarded-For` header from the request. Returns an array
++of the addresses, including the socket address for the `req`. In reverse
++order (i.e. index `0` is the socket address and the last index is the
++furthest address, typically the end-user).
++
++## Testing
++
++```sh
++$ npm test
++```
++
++## License
++
++[MIT](LICENSE)
++
++[npm-image]: https://img.shields.io/npm/v/forwarded.svg?style=flat
++[npm-url]: https://npmjs.org/package/forwarded
++[node-version-image]: https://img.shields.io/node/v/forwarded.svg?style=flat
++[node-version-url]: http://nodejs.org/download/
++[travis-image]: https://img.shields.io/travis/jshttp/forwarded.svg?style=flat
++[travis-url]: https://travis-ci.org/jshttp/forwarded
++[coveralls-image]: https://img.shields.io/coveralls/jshttp/forwarded.svg?style=flat
++[coveralls-url]: https://coveralls.io/r/jshttp/forwarded?branch=master
++[downloads-image]: https://img.shields.io/npm/dm/forwarded.svg?style=flat
++[downloads-url]: https://npmjs.org/package/forwarded
+--- /dev/null
++++ node-proxy-addr-1.0.3/node_modules/forwarded/index.js
+@@ -0,0 +1,35 @@
++/*!
++ * forwarded
++ * Copyright(c) 2014 Douglas Christopher Wilson
++ * MIT Licensed
++ */
++
++/**
++ * Module exports.
++ */
++
++module.exports = forwarded
++
++/**
++ * Get all addresses in the request, using the `X-Forwarded-For` header.
++ *
++ * @param {Object} req
++ * @api public
++ */
++
++function forwarded(req) {
++  if (!req) {
++    throw new TypeError('argument req is required')
++  }
++
++  // simple header parsing
++  var proxyAddrs = (req.headers['x-forwarded-for'] || '')
++    .split(/ *, */)
++    .filter(Boolean)
++    .reverse()
++  var socketAddr = req.connection.remoteAddress
++  var addrs = [socketAddr].concat(proxyAddrs)
++
++  // return all addresses
++  return addrs
++}
+--- /dev/null
++++ node-proxy-addr-1.0.3/node_modules/forwarded/package.json
+@@ -0,0 +1,33 @@
++{
++  "name": "forwarded",
++  "description": "Parse HTTP X-Forwarded-For header",
++  "version": "0.1.0",
++  "contributors": [
++    "Douglas Christopher Wilson <doug at somethingdoug.com>"
++  ],
++  "license": "MIT",
++  "keywords": [
++    "x-forwarded-for",
++    "http",
++    "req"
++  ],
++  "repository": "jshttp/forwarded",
++  "devDependencies": {
++    "istanbul": "0.3.2",
++    "mocha": "~1.21.4"
++  },
++  "files": [
++    "LICENSE",
++    "HISTORY.md",
++    "README.md",
++    "index.js"
++  ],
++  "engines": {
++    "node": ">= 0.6"
++  },
++  "scripts": {
++    "test": "mocha --reporter spec --bail --check-leaks test/",
++    "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
++    "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"
++  }
++}
+--- /dev/null
++++ node-proxy-addr-1.0.3/node_modules/forwarded/test/test.js
+@@ -0,0 +1,37 @@
++
++var assert = require('assert')
++var forwarded = require('..')
++
++describe('forwarded(req)', function () {
++  it('should require req', function () {
++    assert.throws(forwarded.bind(null), /argument req.*required/)
++  })
++
++  it('should work with X-Forwarded-For header', function () {
++    var req = createReq('127.0.0.1')
++    assert.deepEqual(forwarded(req), ['127.0.0.1'])
++  })
++
++  it('should include entries from X-Forwarded-For', function () {
++    var req = createReq('127.0.0.1', {
++      'x-forwarded-for': '10.0.0.2, 10.0.0.1'
++    })
++    assert.deepEqual(forwarded(req), ['127.0.0.1', '10.0.0.1', '10.0.0.2'])
++  })
++
++  it('should skip blank entries', function () {
++    var req = createReq('127.0.0.1', {
++      'x-forwarded-for': '10.0.0.2,, 10.0.0.1'
++    })
++    assert.deepEqual(forwarded(req), ['127.0.0.1', '10.0.0.1', '10.0.0.2'])
++  })
++})
++
++function createReq(socketAddr, headers) {
++  return {
++    connection: {
++      remoteAddress: socketAddr
++    },
++    headers: headers || {}
++  };
++}
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..ef01e07
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+0000-bundle_forwarded.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-proxy-addr.git



More information about the Pkg-javascript-commits mailing list