Merge branch 'master' of ssh://git.code.sf.net/p/hl7api/fhircode
This commit is contained in:
commit
58bb97e6d0
|
@ -625,6 +625,11 @@ public class RestfulServer extends HttpServlet {
|
||||||
resourceMethod.invokeServer(this, r, theResponse);
|
resourceMethod.invokeServer(this, r, theResponse);
|
||||||
|
|
||||||
} catch (AuthenticationException e) {
|
} catch (AuthenticationException e) {
|
||||||
|
String userAgent = theRequest.getHeader("User-Agent");
|
||||||
|
if (userAgent != null && userAgent.contains("Mozilla")) {
|
||||||
|
//if request is coming from a browser, prompt the user to enter login credentials
|
||||||
|
theResponse.setHeader("WWW-Authenticate", "BASIC realm=\"FHIR\"");
|
||||||
|
}
|
||||||
theResponse.setStatus(e.getStatusCode());
|
theResponse.setStatus(e.getStatusCode());
|
||||||
addHeadersToResponse(theResponse);
|
addHeadersToResponse(theResponse);
|
||||||
theResponse.setContentType("text/plain");
|
theResponse.setContentType("text/plain");
|
||||||
|
|
Loading…
Reference in New Issue