coreruleset / documentation

CRS Documentation
https://coreruleset.org/docs/
4 stars 20 forks source link

Verify corectness of template tests #85

Closed RedXanadu closed 1 year ago

RedXanadu commented 1 year ago

Every time that I copy-paste one of the agreed 'example tests' from the Contribution Guidelines document, my PR gets errors.

We need to verify that the template "gold standard" tests are correct.

Link to the test templates: https://github.com/coreruleset/documentation/blob/main/content/development/contribution_guidelines.md#positive-tests

RedXanadu commented 1 year ago

I believe that the user agent needs to be changed to:

User-Agent: "OWASP CRS test agent"

Was this modified at some point but the documentation didn't get updated?


Also, it looks like the linter is unhappy for some reason with Accept headers, and they now require double-quote marks to work, so they need to be:

Accept: "*/*"

Although I note that the current example tests work fine in Go-FTW, no quote marks needed. Just the linter is unhappy for some reason.


@fzipi, you're probably the best source of knowledge on how testing works. Can you confirm please that these changes are correct? We need to ensure that the template tests we provide are correct.

dune73 commented 1 year ago

I confirm on the UA change.

Accept: Interesting. Funny thing is we use a crazy long Accept header for almost all existing tests. I would not mind cleaning this up to something much simpler.

theseion commented 1 year ago

The Accept header thing is probably just because * is a special token in YAML.