From e197012e7aeeb0feb1b27290fc18285b25910168 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Romanowski?= Date: Wed, 2 Dec 2020 23:07:52 +0100 Subject: [PATCH] Update troubleshooting guide, add .editorconfig (#60) --- .editorconfig | 19 +++++++++++++++++++ README.md | 4 ++-- TROUBLESHOOTING.md | 26 +++++++++++++++----------- 3 files changed, 36 insertions(+), 13 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..a7363d7 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,19 @@ +root = true + +[*] +end_of_line = lf +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true + +[*.rs] +indent_size = 4 + +[*.html] +indent_size = 2 + +[*.yml] +indent_size = 2 + +[Makefile] +indent_style = tab diff --git a/README.md b/README.md index 96b3fc7..1ea87ea 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ![Rust](https://github.com/hello-rust/lychee/workflows/Rust/badge.svg) -A fast, async, resource-friendly link checker written in Rust. +A fast, async, resource-friendly link checker written in Rust. \ For GitHub links, it can optionally use a `GITHUB_TOKEN` to avoid getting blocked by the rate limiter. @@ -65,7 +65,7 @@ This comparison is made on a best-effort basis. Please create a PR to fix outdat ## Contributing to lychee -We'd be thankful for any contribution. +We'd be thankful for any contribution. \ We try keep the issue-tracker up-to-date so you can quickly find a task to work on. Try one of these links to get started: diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md index f1e3ebf..a786fff 100644 --- a/TROUBLESHOOTING.md +++ b/TROUBLESHOOTING.md @@ -1,22 +1,26 @@ -# Toubleshooting Guide +# Troubleshooting Guide -This document describes common edge-cases and workarounds for checking links to various sites. -Please add your own findings and send us a pull request if you can. +This document describes common edge-cases and workarounds for checking links to various sites. \ +Please add your own findings and send us a pull request if you can. ## Unexpected Status Codes -Some websites don't respond with a `200` (OK) status code. -Instead they might send `204` (No Content), `206` (Partial Content), or +Some websites don't respond with a `200` (OK) status code. \ +Instead they might send `204` (No Content), `206` (Partial Content), or [something else entirely](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/418). -If you run into such issues you can work around that by providing a custom +If you run into such issues you can work around that by providing a custom \ list of accepted status codes, such as `--accept 200,204,206`. ## Website Expects Custom Headers -Some sites expect one or more custom headers to return a valid response. -For example, crates.io expects a `Accept: text/html` header or else it -will [return a 404](https://github.com/rust-lang/crates.io/issues/788). +Some sites expect one or more custom headers to return a valid response. \ +For example, crates.io expects a `Accept: text/html` header or else it \ +will [return a 404](https://github.com/rust-lang/crates.io/issues/788). -To fix that you can pass additional headers like so: `--headers "accept=text/html"`. -You can use that argument multiple times to add more headers. +To fix that you can pass additional headers like so: `--headers "accept=text/html"`. \ +You can use that argument multiple times to add more headers. \ +Or, you can accept all content/MIME types: `--headers "accept=*/*"`. + +See more info about the Accept header +[over at MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept).