function demo(request,response){ request.getScheme() is returning http instead of returning https. System.out.println(\"\"+request.getScheme()); }
I used to have a similar problem with getScheme()
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
I've solved using "//" instead:
String basePath = "//"+request.getServerName()+":"+request.getServerPort()+path+"/";