Skip to content

Commit

Permalink
Don't warn on 302 redirects (#1345)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbyrne authored Jun 24, 2020
1 parent 6b3efa6 commit 69b3b5d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<head>` tag so that it would be possible to override default the default assets. ([#1328][github-1328])
Expand Down Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions src/DocChecks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)."
Expand Down

0 comments on commit 69b3b5d

Please sign in to comment.