{"ava":{"failFast":false,"files":["dist/tests/**/*.js"],"timeout":"1m"},"description":"hint for best practices related to HTTP redirects","devDependencies":{"@hint/utils-tests-helpers":"^1.0.1","ava":"^0.25.0","cpx":"^1.5.0","eslint":"^5.5.0","eslint-plugin-import":"^2.14.0","eslint-plugin-markdown":"^1.0.0-beta.7","eslint-plugin-typescript":"^0.12.0","hint":"^3.3.2","markdownlint-cli":"^0.13.0","npm-link-check":"^2.0.0","npm-run-all":"^4.1.2","nyc":"^13.0.1","rimraf":"^2.6.2","typescript":"^3.0.3","typescript-eslint-parser":"^18.0.0"},"engines":{"node":">=8.0.0"},"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":"^3.3.2"},"repository":{"type":"git","url":"git+https://github.com/webhintio/hint.git"},"scripts":{"build":"npm run clean && npm-run-all build:*","build-release":"npm run clean && npm run build:assets && tsc --inlineSourceMap false --removeComments true","build:assets":"cpx \"./{src,tests}/**/{!(*.ts),.!(ts)}\" dist","build:ts":"tsc","clean":"rimraf dist","lint":"npm-run-all lint:*","lint:js":"eslint . --cache --ext js --ext md --ext ts --ignore-path ../../.eslintignore --report-unused-disable-directives","lint:md":"markdownlint --ignore CHANGELOG.md *.md","test":"npm run lint && npm run build && npm run test-only","test-only":"nyc 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":"1.0.3","bugs":{"url":"https://github.com/webhintio/hint/issues"},"_id":"@hint/hint-no-http-redirects@1.0.3","_npmVersion":"6.4.1","_nodeVersion":"10.4.0","_npmUser":{"name":"alrra","email":"alrraa@gmail.com"},"dist":{"integrity":"sha512-BHNwcDnbqZxdR3/LeoB8voKSsRZUfXfyuzHnvCEnxdcuH5VRS+osKLzIpTLQarwjn8CdDwBYhwZi4Eg151MqeQ==","shasum":"90cfbca0590918b51693eb91af88571fef5418e3","tarball":"http://registry-npm.ywwl.com/@hint/hint-no-http-redirects/download/@hint/hint-no-http-redirects-1.0.3.tgz","fileCount":6,"unpackedSize":20549,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbkbQDCRA9TVsSAnZWagAAvi0P/idXzSvke8pirYtHq8Kf\n+zSev/2HW0mUiTvJSZPUPn7iete4Q8fXAMYN6yCGQLJGfhxJYr0BrWMG6Vax\npgM+38CT0uYx1urVskTR2b3zo5Jn8KaSEZujYjZoF+dHUlGuckPFhyUrupZX\n8hi9S6cDy9mGBB0jUfsR1mRCNiXhGIZxAWaYvTFMEpmZDdocJv3Tpr7FhtEs\nFN2DIDcILo4FfckFdRt9oRP8ffs7Y1MU5c7+KwpZ6FyWXcgwpj9SAzGDP9pZ\ndad/BXYQ2Loj6lzckJVfB1ZKCIko+RabvC7kJmYmYyKNEqvecmth3K9q2iRG\nfTrTLB0RsjbJfOVopH+H8j2Or9pfxzQ5kXGZKSppvaYO1OpxTH9gBtN5f9Sh\nWQEBPLNiuHaUFFqzvvZTdWtXtH2SgBgB62gTTHjQaRpkOkbMHO3RlG1FvM4J\nPGzSyqnvJxtnidpAHlb68u5enAFcyvd2wFSezXYWblZ4W/Fzz3JsgJdqNhJy\nz6H86Oax02MCANT7pRJud8k8OkVHg0WlJuYNdSwcSjI3B637lStnKDQbuECO\nXhEJgsGDsEX3dmYhMS7QGOd7hYJmQcnsF5AKD6AtWOoVpvUAWWNVw+uE6aCX\nLLj6EIcXM9/nbHE4AF+WIuW1bBGQVxUftOrieTtRnGSkr6JFvPwEvizK4os4\nTVL7\r\n=GrHF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCuGmr1A9TxeTWbMV2B/fWunZQOKb+0FFdbP39zqNrwgQIhALjSgwFa0dd7iNSZQRypfLISgujWoLCNL142nKN8qNC0"}],"size":7789,"noattachment":false,"key":"/@hint/hint-no-http-redirects/-/@hint/hint-no-http-redirects-1.0.3.tgz"},"maintainers":[{"name":"alrra","email":"alrraa@gmail.com"},{"name":"molant","email":"amolleda@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hint-no-http-redirects_1.0.3_1536275458609_0.30449959457103115"},"_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":1536275458716,"_cnpm_publish_time":1536275458716,"dist-tags":{"latest":"3.0.23"}}