teler-sh / teler-waf

teler-waf is a Go HTTP middleware that protects local web services from OWASP Top 10 threats, known vulnerabilities, malicious actors, botnets, unwanted crawlers, and brute force attacks.
https://test.teler.sh
Apache License 2.0
344 stars 32 forks source link

refactor: move `getResources()` method call down #71

Closed dwisiswant0 closed 1 year ago

dwisiswant0 commented 1 year ago

IMPORTANT: Please do not create a PR without creating an issue first!

(Any change needs to be discussed before proceeding. Failure to do so may result in the rejection of the pull request).

Summary

The commit moves the (*Teler).getResources() method call down in the New() function. This was done because the previous placement of the call caused an unexpected behavior (InMemory is always false), and moving it to a later stage in the function resolves the issue.

Proposed of changes

This PR fixes/implements the following bugs/features:

How has this been tested?

Proof:

Closing issues

Fixes #

Checklist:

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage: 40.00% and project coverage change: +1.92% :tada:

Comparison is base (bf69f81) 72.44% compared to head (d316c6d) 74.37%. Report is 1 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #71 +/- ## ========================================== + Coverage 72.44% 74.37% +1.92% ========================================== Files 5 5 Lines 998 999 +1 ========================================== + Hits 723 743 +20 + Misses 229 208 -21 - Partials 46 48 +2 ``` | [Files Changed](https://app.codecov.io/gh/kitabisa/teler-waf/pull/71?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kitabisa) | Coverage Δ | | |---|---|---| | [teler.go](https://app.codecov.io/gh/kitabisa/teler-waf/pull/71?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kitabisa#diff-dGVsZXIuZ28=) | `72.02% <40.00%> (+4.78%)` | :arrow_up: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.