Skip to content

Commit

Permalink
Merge pull request #206 from mattn/shallow-405-method-not-allowed-in-…
Browse files Browse the repository at this point in the history
…process

shallow 405 Method Not Allowed in process()
  • Loading branch information
shogo82148 authored Sep 21, 2021
2 parents d16f527 + c814499 commit a36c7ef
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions goveralls.go
Original file line number Diff line number Diff line change
Expand Up @@ -513,9 +513,20 @@ func process() error {
return fmt.Errorf("unable to read response body from coveralls: %s", err)
}

if res.StatusCode >= http.StatusInternalServerError && *shallow {
fmt.Println("coveralls server failed internally")
return nil
if *shallow {
if res.StatusCode >= http.StatusInternalServerError {
fmt.Println("coveralls server failed internally")
return nil
}

// XXX: It looks that Coveralls is under maintenance.
// Coveralls serves the maintenance page as a static HTML hosting,
// and the maintenance page doesn't accept POST method.
// See https://github.com/mattn/goveralls/issues/204
if res.StatusCode == http.StatusMethodNotAllowed {
fmt.Println("it looks that Coveralls is under maintenance. visit https://status.coveralls.io/")
return nil
}
}

if res.StatusCode != 200 {
Expand Down

0 comments on commit a36c7ef

Please sign in to comment.