Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding stricter check on offline templates list #2213

Merged
merged 1 commit into from
Jul 11, 2022

Conversation

Mzack9999
Copy link
Member

@Mzack9999 Mzack9999 commented Jun 22, 2022

Proposed changes

This PR implements a stricter check on list of templates used for offline matching, discarding raw ones

Checklist

  • Pull request is created against the dev branch
  • All checks passed (lint, unit/integration/regression tests etc.) with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Notes

Once #2192 is merged, the following test templates should be added to offline integration tests:

offline-allowed-paths => match

id: offline-allowed-paths

info:
  name: offline-allowed-paths
  author: pdteam
  severity: info
  description: offline-allowed-paths

requests:
  - path:
      - "{{BaseURL}}"
      - "{{BaseURL}}/"
      - "/"

    matchers:
      - type: status
        status:
          - 200

offline-raw.yaml => no match

id: offline-raw
info:
  name: Test Offline raw Template
  author: pdteam
  severity: info

requests:
  - raw:
      - |
        GET / HTTP/1.1
        Host: {{Hostname}}
        
    matchers:
      - type: status
        status:
          - 200

test.txt

HTTP/1.1 200 OK
Date: Tue, 21 Jun 2022 09:32:01 GMT
Content-Type: text/plain; charset=utf-8
Connection: close
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1;mode=block
cache-control: public, max-age=1801
CF-Cache-Status: HIT
Age: 1585
Last-Modified: Tue, 21 Jun 2022 09:05:36 GMT
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Server: cloudflare
CF-RAY: 71ebbc0a7ea83b8b-CDG

45
line1
this is a line containing FOO BAR
line3
0

@Mzack9999 Mzack9999 added the Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors. label Jun 22, 2022
@Mzack9999 Mzack9999 self-assigned this Jun 22, 2022
@Mzack9999 Mzack9999 added the Status: Review Needed The issue has a PR attached to it which needs to be reviewed label Jun 22, 2022
@Mzack9999 Mzack9999 linked an issue Jun 22, 2022 that may be closed by this pull request
@ehsandeep ehsandeep merged commit 3c945f6 into dev Jul 11, 2022
@ehsandeep ehsandeep deleted the issue-2067-offline-matches branch July 11, 2022 17:08
@ehsandeep ehsandeep added Status: Completed Nothing further to be done with this issue. Awaiting to be closed. and removed Status: Review Needed The issue has a PR attached to it which needs to be reviewed labels Jul 11, 2022
@ehsandeep
Copy link
Member

Since #2192 is now merged, @Mzack9999 could you please add the above templates as part of the test?

@Mzack9999 Mzack9999 mentioned this pull request Jul 11, 2022
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Completed Nothing further to be done with this issue. Awaiting to be closed. Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unexpected matches with passive mode
3 participants