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

security-proxy - Intercept "connection refused" errors #963

Merged
merged 1 commit into from Apr 21, 2015

Conversation

Projects
None yet
2 participants
@pmauduit
Member

pmauduit commented Apr 21, 2015

This PR is related to the issue #961.

If underlying webapps are unavailable, an empty webpage is produced
(Content-length: 0), no log traces are produced (a printStackTrace() is
done anyway), and a 200 OK status code is returned.

This commit provides:

  • A 503 "service unavailable" status code is returned instead
  • A default status page for 503 (as it is currently done for 403 and 404
    statuses) is produced,
  • A log trace is correctly (in the correct log file, not on stdout) is
    printed.

Note that the 503 error code can also be intercepted by the frontend
server, so that a custom error page is returned.

Show outdated Hide outdated security-proxy/src/main/java/org/georchestra/security/Proxy.java
@@ -612,7 +612,13 @@ private void handleRequest(HttpServletRequest request, HttpServletResponse final
}
} catch (IOException e) {
// connection problem with the host
e.printStackTrace();
logger.error("Exception occured when trying to connect onto the remote host: ", e);

This comment has been minimized.

@fvanderbiest

fvanderbiest Apr 21, 2015

Member

"connect to" ?

@fvanderbiest

fvanderbiest Apr 21, 2015

Member

"connect to" ?

This comment has been minimized.

@pmauduit

pmauduit Apr 21, 2015

Member

done

@fvanderbiest

This comment has been minimized.

Show comment
Hide comment
@fvanderbiest

fvanderbiest Apr 21, 2015

Member

Looks good !

Member

fvanderbiest commented Apr 21, 2015

Looks good !

security-proxy - Intercept "connection refused" errors
If underlying webapps are unavailable, an empty webpage is produced
(Content-length: 0), no log traces are produced (a printStackTrace() is
done anyway), and a 200 OK status code is returned.

This commit provides:
- A 503 "service unavailable" status code is returned instead
- A default status page for 503 (as it is currently done for 403 and 404
  statuses) is produced,
- A log trace is correctly (in the correct log file, not on stdout) is
  printed.

Note that the 503 error code can also be intercepted by the frontend
server, so that a custom error page is returned.

fvanderbiest added a commit that referenced this pull request Apr 21, 2015

Merge pull request #963 from pmauduit/sp-http503-for-connection-refused
security-proxy - Intercept "connection refused" errors

@fvanderbiest fvanderbiest merged commit 002db53 into georchestra:master Apr 21, 2015

1 check was pending

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details

@fvanderbiest fvanderbiest added this to the 15.06 milestone Apr 21, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment