comparison mod_http_oauth2/mod_http_oauth2.lua @ 5960:538f468f9a65

mod_http_oauth2: Simplify negation in condition
author Kim Alvefur <zash@zash.se>
date Sat, 31 Aug 2024 14:46:33 +0200
parents 5f8a306c8306
children 7308ec4aaad1
comparison
equal deleted inserted replaced
5959:111eeffb6adf 5960:538f468f9a65
33 if not url_parts then return url_parts; end 33 if not url_parts then return url_parts; end
34 if url_parts.userinfo then return false; end 34 if url_parts.userinfo then return false; end
35 if url_parts.port then 35 if url_parts.port then
36 local port = tonumber(url_parts.port); 36 local port = tonumber(url_parts.port);
37 if not port then return false; end 37 if not port then return false; end
38 if not (port > 0 and port <= 0xffff) then return false; end 38 if port <= 0 or port > 0xffff then return false; end
39 if port ~= math.floor(port) then return false; end 39 if port ~= math.floor(port) then return false; end
40 end 40 end
41 if url_parts.host then 41 if url_parts.host then
42 if encodings.stringprep.nameprep(url_parts.host) ~= url_parts.host then 42 if encodings.stringprep.nameprep(url_parts.host) ~= url_parts.host then
43 return false; 43 return false;