detailyang / lua-resty-cors

It's the implement of CORS on OpenResty
MIT License
56 stars 18 forks source link

add small optimization #5

Closed danielmotaleite closed 6 years ago

danielmotaleite commented 6 years ago

Please add this small optimization, if it match already, no need to keep checking other allow_host. This may save many CPU cycles in a request heavy server when several allow_hosts are used

Around line 82:

if from then
            matched = true
+          break
end

Thanks! :)

detailyang commented 6 years ago

done