From 69b3b5d318116ec4ed1bfd4e30b524825b6ad94e Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Wed, 24 Jun 2020 15:46:22 -0700 Subject: [PATCH] Don't warn on 302 redirects (#1345) --- CHANGELOG.md | 4 ++++ src/DocChecks.jl | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3af8cd7ebe..a026826403 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ * ![Enhancement][badge-enhancement] The LaTeX/PDF backend now supports the `platform="none"` keyword, which outputs only the TeX source files, rather than a compiled PDF. ([#1338][github-1338], [#1339][github-1339]) +* ![Enhancement][badge-enhancement] Linkcheck no longer prints a warning when enountering a `302 Found` temporary redirect. ([#1344][github-1344], [#1345][github-1345]) + * ![Bugfix][badge-bugfix] `Deps.pip` is again a closure and gets executed during the `deploydocs` call, not before it. ([#1240][github-1240]) * ![Bugfix][badge-bugfix] Custom assets (CSS, JS etc.) for the HTML build are now again included as the very last elements in the `` tag so that it would be possible to override default the default assets. ([#1328][github-1328]) @@ -584,6 +586,8 @@ [github-1328]: https://github.com/JuliaDocs/Documenter.jl/pull/1328 [github-1338]: https://github.com/JuliaDocs/Documenter.jl/issues/1338 [github-1339]: https://github.com/JuliaDocs/Documenter.jl/pull/1339 +[github-1344]: https://github.com/JuliaDocs/Documenter.jl/issues/1344 +[github-1345]: https://github.com/JuliaDocs/Documenter.jl/pull/1345 [documenterlatex]: https://github.com/JuliaDocs/DocumenterLaTeX.jl [documentermarkdown]: https://github.com/JuliaDocs/DocumenterMarkdown.jl diff --git a/src/DocChecks.jl b/src/DocChecks.jl index f92a4e0525..66476224cf 100644 --- a/src/DocChecks.jl +++ b/src/DocChecks.jl @@ -215,9 +215,13 @@ function linkcheck(link::Markdown.Link, doc::Documents.Document; method::Symbol= protocol = startswith(scheme, "HTTP") ? :HTTP : startswith(scheme, "FTP") ? :FTP : :UNKNOWN - if (protocol === :HTTP && status < 300) || + if (protocol === :HTTP && (status < 300 || status == 302)) || (protocol === :FTP && (200 <= status < 300 || status == 350)) - @debug "linkcheck '$(link.url)' status: $(status)." + if location !== nothing + @debug "linkcheck '$(link.url)' status: $(status), redirects to $(location)." + else + @debug "linkcheck '$(link.url)' status: $(status)." + end elseif protocol === :HTTP && status < 400 if location !== nothing @warn "linkcheck '$(link.url)' status: $(status), redirects to $(location)."