Skip to content
Snippets Groups Projects
Commit 3f882b11 authored by Jesus Federico's avatar Jesus Federico
Browse files

bbb-lti: Fixed issue that prevented https to work on nginx/tomcat

parent 52c7aceb
No related branches found
No related tags found
No related merge requests found
......@@ -54,7 +54,7 @@ class ToolController {
ltiService.logParameters(params)
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>()
ArrayList<String> missingParams = new ArrayList<String>()
......@@ -398,4 +398,18 @@ class ToolController {
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
}
}
......@@ -4,6 +4,7 @@
proxy_pass http://127.0.0.1:8080;
proxy_redirect default;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Scheme $scheme;
# Allow 30M uploaded presentation document.
client_max_body_size 30m;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment