Merge pull request #461 from jfederico/master

bbb-lti: Fixed issue that prevented https to work on nginx/tomcat
This commit is contained in:
Jesus Federico 2014-12-10 11:34:03 -05:00
commit 821d4cbe01
2 changed files with 16 additions and 1 deletions

View File

@ -54,7 +54,7 @@ class ToolController {
ltiService.logParameters(params) ltiService.logParameters(params)
if( request.post ){ if( request.post ){
def endPoint = (request.isSecure()?"https":"http") + "://" + ltiService.endPoint + "/" + grailsApplication.metadata['app.name'] + "/" + params.get("controller") + (params.get("format") != null? "." + params.get("format"): "") def endPoint = getScheme() + "://" + ltiService.endPoint + "/" + grailsApplication.metadata['app.name'] + "/" + params.get("controller") + (params.get("format") != null? "." + params.get("format"): "")
Map<String, String> result = new HashMap<String, String>() Map<String, String> result = new HashMap<String, String>()
ArrayList<String> missingParams = new ArrayList<String>() ArrayList<String> missingParams = new ArrayList<String>()
@ -398,4 +398,18 @@ class ToolController {
return cartridge return cartridge
} }
private String getScheme(){
def scheme
if ( request.isSecure() ) {
scheme = 'https'
} else {
scheme = request.getHeader("scheme")
if ( scheme == null || !(scheme == 'http' || scheme == 'https') ) {
scheme = 'http'
}
}
return scheme
}
} }

View File

@ -4,6 +4,7 @@
proxy_pass http://127.0.0.1:8080; proxy_pass http://127.0.0.1:8080;
proxy_redirect default; proxy_redirect default;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Scheme $scheme;
# Allow 30M uploaded presentation document. # Allow 30M uploaded presentation document.
client_max_body_size 30m; client_max_body_size 30m;