mod_http_oauth2/mod_http_oauth2.lua
changeset 5771 a967bb4972c5
parent 5770 b8a2b3ebe792
child 5774 990c6adc4407
equal deleted inserted replaced
5770:b8a2b3ebe792 5771:a967bb4972c5
  1331 	end
  1331 	end
  1332 end
  1332 end
  1333 
  1333 
  1334 local function redirect_uri_allowed(redirect_uri, client_uri, app_type)
  1334 local function redirect_uri_allowed(redirect_uri, client_uri, app_type)
  1335 	local uri = url.parse(redirect_uri);
  1335 	local uri = url.parse(redirect_uri);
       
  1336 	if not uri then
       
  1337 		return false;
       
  1338 	end
  1336 	if not uri.scheme then
  1339 	if not uri.scheme then
  1337 		return false; -- no relative URLs
  1340 		return false; -- no relative URLs
  1338 	end
  1341 	end
  1339 	if app_type == "native" then
  1342 	if app_type == "native" then
  1340 		return uri.scheme == "http" and loopbacks:contains(uri.host) or redirect_uri == oob_uri or uri.scheme:find(".", 1, true) ~= nil;
  1343 		return uri.scheme == "http" and loopbacks:contains(uri.host) or redirect_uri == oob_uri or uri.scheme:find(".", 1, true) ~= nil;