{"ava":{"failFast":false,"files":["dist/tests/**/*.js","!dist/tests/**/fixtures/**/*.js"],"timeout":"1m"},"dependencies":{"@hint/utils-i18n":"^1.0.1","@hint/utils-string":"^1.0.1","@hint/utils-types":"^1.0.1"},"description":"hint for best practices related to HTTP redirects","devDependencies":{"@hint/utils-create-server":"^3.4.2","@hint/utils-tests-helpers":"^6.1.0","@types/node":"^12.12.14","@typescript-eslint/eslint-plugin":"^1.13.0","@typescript-eslint/parser":"^1.12.0","ava":"^3.4.0","cpx":"^1.5.0","eslint":"^6.8.0","eslint-plugin-import":"^2.18.2","eslint-plugin-markdown":"^1.0.2","npm-run-all":"^4.1.5","nyc":"^15.0.0","rimraf":"^3.0.2","typescript":"^3.8.3"},"homepage":"https://webhint.io/","keywords":["no-http-redirects","no-http-redirects-hint","webhint","webhint-hint","webhint-recommended"],"license":"Apache-2.0","main":"dist/src/hint.js","name":"@hint/hint-no-http-redirects","nyc":{"extends":"../../.nycrc"},"peerDependencies":{"hint":"^6.0.0"},"repository":{"directory":"packages/hint-no-http-redirects","type":"git","url":"git+https://github.com/webhintio/hint.git"},"scripts":{"build":"npm run i18n && npm-run-all build:*","build-release":"npm run clean && npm run i18n && npm run build:assets && tsc --inlineSourceMap false --removeComments true","build:assets":"cpx \"./{src,tests}/**/{!(*.ts),.!(ts)}\" dist","build:ts":"tsc -b","clean":"rimraf dist","i18n":"node ../../scripts/create-i18n.js","lint":"npm-run-all lint:*","lint:js":"eslint . --cache --ext .js,.md,.ts --ignore-path ../../.eslintignore","lint:dependencies":"node ../../scripts/lint-dependencies.js","lint:md":"node ../../scripts/lint-markdown.js","test":"npm run i18n && npm run lint && npm run build && npm run test-only","test-only":"nyc ava","test-release":"npm run i18n && npm run lint && npm run build-release && ava","watch":"npm run build && npm-run-all --parallel -c watch:*","watch:assets":"npm run build:assets -- -w --no-initial","watch:test":"ava --watch","watch:ts":"npm run build:ts -- --watch"},"version":"2.4.2","bugs":{"url":"https://github.com/webhintio/hint/issues"},"_id":"@hint/hint-no-http-redirects@2.4.2","_nodeVersion":"12.16.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-E2KqReKfBYmdPArXt4SCrQHfX8QTygNuJxFPAkBftaW5Ag77fP7ZQ0IO77BycSPjJP9+fT3Yo2cDih9sayfZuQ==","shasum":"48cbd366edb3eefdf588937b429c105729a51726","tarball":"http://registry-npm.ywwl.com/@hint/hint-no-http-redirects/download/@hint/hint-no-http-redirects-2.4.2.tgz","fileCount":14,"unpackedSize":43992,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJecpkYCRA9TVsSAnZWagAApo8QAJ+ejj3sVWh7S6EvnN//\nD1Lfyztd+iSQ4IYu7+UurC6b09CVSJn8xXq2MSERuGRUXsMt7CFy+/mHVhU8\nikL47fdCvuOQP5+ccegTSsOwDuZJqDwGiHISfh+TV3CQmoLUWhySSHzpc0RU\nlvPs2YrMf+Jx3v236Q/6DncfzMGtJ14AjV/WSJj2bd2W91hNTnxbtQhdCvNe\n7C4UEVAyYGhBB+uBuTg/RlzEmDAJLJiNiLg5FPHoBXaABoJnJvpIcA53laKp\nQaKKqSc0SYgb5Q4AC0EFBJ8mfabM1AHUOLgyJoFVZ5sJTWhzC4aCizRe7euE\nGmNBlsPD/C93HC4pDJHancXOmdbj5QQrTMgigi8GW9rai81d7mf/Ct8/qVCF\nPiu0DXNUeaXG1fp1/RNsnGvhEzo9Qa9FcGLpQOIdALdwMbGmesGXdO+vI17P\niOfuZle1rhZvHloS11BsHLPiWFyvI58isIOtDlj+FzLTVM+U0iEPRmkndMnU\nr2GKzlzbvFKXpwa2HNWfS7u9LgatAH5Wvg+701HasMQ3sS7zKu0vNqQ5j8uX\n4N9kSQwRlMy1obfX8RlA45mnwL03Lm8VWzYgrWqkdez5PUSLZcLgc0t7b41W\nzslMn5i823DuKInapcIN7T4v9/vevKAOaaexOq4jj90bfK1B2TTPMIV8DNJd\n1NIj\r\n=jwLf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHXainkUs6ZScLj89iRubafSv/kBh5lQqQ42oX4pBRnBAiEA1C5ijpi3URCxTJ/Qh8wqDt2mosDzRS95Vk+VduN7izU="}],"size":13714,"noattachment":false,"key":"/@hint/hint-no-http-redirects/-/@hint/hint-no-http-redirects-2.4.2.tgz"},"maintainers":[{"email":"antross@gmail.com","name":"antross"},{"email":"amolleda@gmail.com","name":"molant"}],"_npmUser":{"name":"antross","email":"antross@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hint-no-http-redirects_2.4.2_1584568600106_0.01646158481361959"},"_hasShrinkwrap":false,"readme":"# Avoid HTTP redirects (`no-http-redirects`)\n\n`no-http-redirects` checks if there are any HTTP redirects in the page\n`webhint` is analyzing.\n\n## Why is this important?\n\nConsider the following simplified description of what happens when\na user requests a URL within a browser:\n\n1. DNS Lookup: Translate the server domain to an IP. If the browser\n   doesn’t know it, it asks a DNS server which in some cases involves\n   multiple queries until the final IP is obtained.\n1. Open a [TCP connection][wikipedia-tcp-establishment] to the server\n   IP address requesting the URL.\n1. The server responds to that request by sending some content over\n   the TCP connection.\n   If the resource uses SSL, then [TLS negotiation(s)][wikipedia-tls-handshake]\n   happens as well.\n\nWhen a redirect occurs, `3.` contains the new URL the browser needs to\nrequest, repeating the whole sequence of steps. DNS Lookup isn’t cheap,\nneither is [creating a TCP connection][tcp-connection-diagram]. The\nimpact of redirects is felt even more by mobile users, where the [network\nlatency is usually higher][pagespeed-insights].\nAs a rule of thumb, the more you can avoid redirects the better.\n\n## What does the hint check?\n\nThis hint checks:\n\n* If the target URL passed to `webhint` has any redirect. E.g.:\n  `http://www.example.com` --> `http://example.com`\n* If any resource in the page has any redirect. E.g.:\n  `http://example.com/script.js` --> `https://example.com/script.js`\n\nand alerts if at least one is found.\n\n### Examples that **trigger** the hint\n\n* Any URL passed to `webhint` that redirects to another one\n* Any page with a resource (script, css, image) behind a redirect\n\n### Examples that **pass** the hint\n\n* No redirect for resources nor the target URL.\n\n## Can the hint be configured?\n\nBy default, no redirects are allowed but you can change this behavior.\n\nThe following hint configuration used in the [`.hintrc`][hintrc]\nfile will allow 3 redirects for resources and 1 for the main URL:\n\n```json\n{\n    \"connector\": {...},\n    \"formatters\": [...],\n    \"hints\": {\n        \"no-http-redirects\": [\"error\", {\n            \"max-resource-redirects\": 3,\n            \"max-html-redirects\": 1\n        }],\n        ...\n    },\n    ...\n}\n```\n\n## How to use this hint?\n\nThis package is installed automatically by webhint:\n\n```bash\nnpm install hint --save-dev\n```\n\nTo use it, activate it via the [`.hintrc`][hintrc] configuration file:\n\n```json\n{\n    \"connector\": {...},\n    \"formatters\": [...],\n    \"hints\": {\n        \"no-http-redirects\": \"error\",\n        ...\n    },\n    \"parsers\": [...],\n    ...\n}\n```\n\n**Note**: The recommended way of running webhint is as a `devDependency` of\nyour project.\n\n## Further Reading\n\n* [Mobile Analysis in PageSpeed Insights][pagespeed-insights]\n* [50 performance tricks to make your HTML5 apps and sites faster][50-tricks]\n  (skip to 19:35)\n* [Domain Names - Implementation and Specification][rfc1035]\n* [How DNS Works][how-dns-works]\n* [Redirections in HTTP][MDN-Redirections]\n* [Transmission Control Protocol][wikipedia-tcp]\n\n<!-- Link labels: -->\n\n[50-tricks]: https://channel9.msdn.com/events/Build/2012/3-132#time=19m35s\n[how-dns-works]: https://www.verisign.com/en_US/website-presence/online/how-dns-works/index.xhtml\n[MDN-Redirections]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Redirections\n[pagespeed-insights]: https://developers.google.com/speed/docs/insights/mobile#adapting-to-high-latency-mobile-networks\n[rfc1035]: https://tools.ietf.org/html/rfc1035\n[hintrc]: https://webhint.io/docs/user-guide/configuring-webhint/summary/\n[tcp-connection-diagram]: https://www.eventhelix.com/RealtimeMantra/Networking/tcp/#.WgOQBkxFy2c\n[wikipedia-tcp-establishment]: https://en.wikipedia.org/wiki/Transmission_Control_Protocol#Connection_establishment\n[wikipedia-tcp]: https://en.wikipedia.org/wiki/Transmission_Control_Protocol\n[wikipedia-tls-handshake]: https://en.wikipedia.org/wiki/Transport_Layer_Security#TLS_handshake\n","publish_time":1584568600228,"_cnpm_publish_time":1584568600228,"dist-tags":{"latest":"3.0.23"}}