Project rename
This commit is contained in:
+2
@@ -0,0 +1,2 @@
|
||||
node_modules/
|
||||
*.log
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- "0.10"
|
||||
- "0.12"
|
||||
- "4.2"
|
||||
- "5"
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014, 2015 Evan Hahn, Adam Baldwin
|
||||
|
||||
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.
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
Internet Explorer, restrict untrusted HTML
|
||||
==========================================
|
||||
[](https://travis-ci.org/helmetjs/ienoopen)
|
||||
[](http://standardjs.com/)
|
||||
|
||||
This middleware sets the `X-Download-Options` header to `noopen` to prevent Internet Explorer users from executing downloads in your site's context.
|
||||
|
||||
```javascript
|
||||
var ienoopen = require('ienoopen');
|
||||
app.use(ienoopen());
|
||||
```
|
||||
|
||||
Some web applications will serve untrusted HTML for download. By default, some versions of IE will allow you to open those HTML files *in the context of your site*, which means that an untrusted HTML page could start doing bad things in the context of your pages. For more, see [this MSDN blog post](http://blogs.msdn.com/b/ie/archive/2008/07/02/ie8-security-part-v-comprehensive-protection.aspx).
|
||||
|
||||
This is pretty obscure, fixing a small bug on IE only. No real drawbacks other than performance/bandwidth of setting the headers, though.
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
module.exports = function ienoopen () {
|
||||
return function ienoopen (req, res, next) {
|
||||
res.setHeader('X-Download-Options', 'noopen')
|
||||
next()
|
||||
}
|
||||
}
|
||||
+107
@@ -0,0 +1,107 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
{
|
||||
"raw": "ienoopen@1.0.0",
|
||||
"scope": null,
|
||||
"escapedName": "ienoopen",
|
||||
"name": "ienoopen",
|
||||
"rawSpec": "1.0.0",
|
||||
"spec": "1.0.0",
|
||||
"type": "version"
|
||||
},
|
||||
"/Users/gerrit/Documents/dev/nodejs/rentfor.camp/html/RentForCamp/node_modules/helmet"
|
||||
]
|
||||
],
|
||||
"_from": "ienoopen@1.0.0",
|
||||
"_id": "ienoopen@1.0.0",
|
||||
"_inCache": true,
|
||||
"_location": "/ienoopen",
|
||||
"_nodeVersion": "5.3.0",
|
||||
"_npmUser": {
|
||||
"name": "evanhahn",
|
||||
"email": "me@evanhahn.com"
|
||||
},
|
||||
"_npmVersion": "3.5.3",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"raw": "ienoopen@1.0.0",
|
||||
"scope": null,
|
||||
"escapedName": "ienoopen",
|
||||
"name": "ienoopen",
|
||||
"rawSpec": "1.0.0",
|
||||
"spec": "1.0.0",
|
||||
"type": "version"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/helmet"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/ienoopen/-/ienoopen-1.0.0.tgz",
|
||||
"_shasum": "346a428f474aac8f50cf3784ea2d0f16f62bda6b",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "ienoopen@1.0.0",
|
||||
"_where": "/Users/gerrit/Documents/dev/nodejs/rentfor.camp/html/RentForCamp/node_modules/helmet",
|
||||
"author": {
|
||||
"name": "Adam Baldwin",
|
||||
"email": "baldwin@andyet.net",
|
||||
"url": "http://andyet.net/team/baldwin"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/helmetjs/ienoopen/issues"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Evan Hahn",
|
||||
"email": "me@evanhahn.com",
|
||||
"url": "http://evanhahn.com"
|
||||
}
|
||||
],
|
||||
"dependencies": {},
|
||||
"description": "Middleware for IE security. Set X-Download-Options to noopen.",
|
||||
"devDependencies": {
|
||||
"connect": "^3.4.0",
|
||||
"mocha": "^2.3.4",
|
||||
"standard": "^5.4.1",
|
||||
"supertest": "^1.1.0"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "346a428f474aac8f50cf3784ea2d0f16f62bda6b",
|
||||
"tarball": "https://registry.npmjs.org/ienoopen/-/ienoopen-1.0.0.tgz"
|
||||
},
|
||||
"gitHead": "b40f380bf07bf3f1a38122297aeee3c3811c6cc4",
|
||||
"homepage": "https://github.com/helmetjs/ienoopen#readme",
|
||||
"keywords": [
|
||||
"helmet",
|
||||
"security",
|
||||
"express",
|
||||
"connect",
|
||||
"noopen",
|
||||
"x-download-options"
|
||||
],
|
||||
"license": "MIT",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "evanhahn",
|
||||
"email": "me@evanhahn.com"
|
||||
}
|
||||
],
|
||||
"name": "ienoopen",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/helmetjs/ienoopen.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "standard && mocha"
|
||||
},
|
||||
"standard": {
|
||||
"global": [
|
||||
"beforeEach",
|
||||
"describe",
|
||||
"it"
|
||||
]
|
||||
},
|
||||
"version": "1.0.0"
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
var ienoopen = require('..')
|
||||
|
||||
var assert = require('assert')
|
||||
var connect = require('connect')
|
||||
var request = require('supertest')
|
||||
|
||||
describe('ienoopen', function () {
|
||||
beforeEach(function () {
|
||||
this.app = connect()
|
||||
this.app.use(ienoopen())
|
||||
this.app.use(function (req, res) {
|
||||
res.setHeader('Content-Disposition', 'attachment; filename=somefile.txt')
|
||||
res.end('Download this cool file!')
|
||||
})
|
||||
})
|
||||
|
||||
it('sets header properly', function (done) {
|
||||
request(this.app).get('/')
|
||||
.expect('X-Download-Options', 'noopen', done)
|
||||
})
|
||||
|
||||
it('names its function and middleware', function () {
|
||||
assert.equal(ienoopen.name, 'ienoopen')
|
||||
assert.equal(ienoopen().name, 'ienoopen')
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user