Skip to content

Commit

Permalink
bbb-lti: Fixed issue that prevented https to work on nginx/tomcat
Browse files Browse the repository at this point in the history
  • Loading branch information
jfederico committed Dec 10, 2014
1 parent 52c7ace commit 3f882b1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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>()

Expand Down Expand Up @@ -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
}
}
1 change: 1 addition & 0 deletions bbb-lti/lti.nginx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3f882b1

Please sign in to comment.