From 80676bfd6d9cb267751bc6c755b02fa06eea498c Mon Sep 17 00:00:00 2001 From: sandeep <8293321+ehsandeep@users.noreply.github.com> Date: Tue, 18 May 2021 22:59:14 +0530 Subject: [PATCH] Simplified matchers --- technologies/magento-detect.yaml | 46 +++++++++++++++----------------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/technologies/magento-detect.yaml b/technologies/magento-detect.yaml index 4f08662bae..6fe18973fd 100644 --- a/technologies/magento-detect.yaml +++ b/technologies/magento-detect.yaml @@ -11,31 +11,29 @@ requests: - method: GET path: - '{{BaseURL}}' - matchers: - - type: dsl - dsl: - - contains(tolower(all_headers), 'x-magento') - part: header - - method: GET - path: + - '{{BaseURL}}/js/varien/product.js' + - '{{BaseURL}}/graphql?query=+{customerDownloadableProducts+{+items+{+date+download_url+order_increment_id+remaining_downloads+status+}}+}' + # There might be a better way to do that, the idea of this check is that Magento might be behind some kind of proxy when # consumed by a SPA/PWA app so we need a valid GraphQL query from Magento to check # https://devdocs.magento.com/guides/v2.4/graphql/ - - '{{BaseURL}}/graphql?query=+{customerDownloadableProducts+{+items+{+date+download_url+order_increment_id+remaining_downloads+status+}}+}' - matchers-condition: and + matchers: - - type: status - status: - - 200 - - type: word - words: - - "The current customer isn't authorized." - part: body - - method: GET - path: - # Based on a check done by magereport.com - - '{{BaseURL}}/js/varien/product.js' - matchers: - - type: status - status: - - 200 \ No newline at end of file + - type: dsl + dsl: + - 'contains(tolower(all_headers), "x-magento")' + - 'status_code == 200' + condition: and + + - type: dsl + dsl: + - 'contains(body, "Magento Core Team")' + - 'status_code == 200' + condition: and + + - type: dsl + dsl: + - 'contains(body, "message")' + - 'contains(body, "The current customer")' + - 'status_code == 200' + condition: and \ No newline at end of file