Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add typhoeus-config user agent and cookies snippets to the README #666

Merged
merged 1 commit into from
Dec 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,28 @@ HTMLProofer.check_directory("out/", {
}}).run
```

Alternatively, you can specifify these options on the commandline with:

```bash
htmlproofer --typhoeus-config='{"headers":{"User-Agent":"Mozilla/5.0 (compatible; My New User-Agent)"}}'
```

### Cookies

Sometimes links fail because they don't have access to cookies. To fix this you can create a .cookies file using the following snippets:

``` ruby
HTMLProofer.check_directory("out/", {
:typhoeus => {
:cookiefile => ".cookies",
:cookiejar => ".cookies"
}}).run
```

```bash
htmlproofer --typhoeus-config='{"cookiefile":".cookies","cookiejar":".cookies"}'
```

### Regular expressions

To exclude urls using regular expressions, include them between forward slashes and don't quote them:
Expand Down