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

405 Response on identify event #2

Open
ashishk20 opened this issue Feb 14, 2024 · 2 comments
Open

405 Response on identify event #2

ashishk20 opened this issue Feb 14, 2024 · 2 comments

Comments

@ashishk20
Copy link

ashishk20 commented Feb 14, 2024

@kuba-orlik Impact Radius routing through browser with following URL on identify event
Request URL: https://airalo.pxf.io/0ZDve3/cur/4440?custid=&oid=&_ir=U25%257C236e8c0e-4f25-4608-b706-eb152d49f5b9%257C1707911171436

Request Method: POST

with response as
Status Code: 405 Method Not Allowed

This URL doesn't look like POST URL, Also note that custid=&oid= are blank

@kuba-orlik
Copy link
Contributor

Thanks for the report. Could you please specify:

  1. What manager are you using to run this MC? WebCM, Zaraz, or something else?
  2. The exact steps one needs to reproduce the issue

@ashishk20
Copy link
Author

ashishk20 commented Feb 16, 2024

@kuba-orlik Here is how I reproduced this issue using WebCM:

Steps to reproduce :

1: Setup webcm.config.ts where target is http://localhost:3002 (this is local page depicting my website which has a single button to send track event on click )
2. Add name of component (name should match with repo name of component impact-radius . This will automatically download and build impact-radius component which you can see at directory webcm/components/impact-radius

export default {
  components: [
    {
      name: 'demo',
      permissions: [
        'access_client_kv',
        'provide_server_functionality',
        'provide_widget',
        'serve_static_files',
        'client_network_requests',
      ],
    },
    {
      name: 'impact-radius',
      settings: {  accountId: "xxxxxxxxxx", 
      td: 'https://airalo.pxf.io/XYZ',
      id: '1234',
      iw: '10',
      },
      permissions: [
        'access_client_kv',
        'provide_server_functionality',
        'provide_widget',
        'serve_static_files',
        'client_network_requests',
      ],
    },
  ],
  target: 'http://localhost:3002',
  hostname: 'localhost',
  trackPath: '/webcm/track',
  ecommerceEventsPath: '/webcm/ecommerce',
  clientEventsPath: '/webcm/system',
  port: 8080
}
  1. run webCM with command npm run dev
  2. You will see following logs [impact radius is initialised]
FOUND LOCAL MC: /Users/ashish/webcm/components/impact-radius/dist/index.js
:: Initialising component impact-radius

WebCM, version 0.10.6

🚀 WebCM is now proxying http://localhost:3002 at http://localhost:8080
  1. Use test page and customise the button Click me to send track event button as follows
    Click me
  2. Start test page on 3002 port
  3. Open http://localhost:8080/ on browser , webCM is a proxy which will inject its script on http://localhost:3002 page
  4. You will see following request getting executed when pressed button Click me to send event! (I converted it in CURL)
curl 'https://airalo.pxf.io/XYZ/cur/1234?custid=&oid=&_ir=U25%257C304f71fd-f417-49d8-87d2-596b90ec42fb%257C1708089296926' \
  -X 'POST' \
  -H 'authority: airalo.pxf.io' \
  -H 'accept: */*' \
  -H 'accept-language: en-GB,en;q=0.9' \
  -H 'content-length: 0' \
  -H 'origin: http://localhost:8080' \
  -H 'referer: http://localhost:8080/' \
  -H 'sec-ch-ua: "Not A(Brand";v="99", "Google Chrome";v="121", "Chromium";v="121"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "macOS"' \
  -H 'sec-fetch-dest: empty' \
  -H 'sec-fetch-mode: cors' \
  -H 'sec-fetch-site: cross-site' \
  -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36' \
  --compressed
  1. The response is
<html>
<head><title>405 POST not supported</title></head>
<body>
<h1>405 POST not supported</h1>
<p /><hr />
<small>
</body></html>
  1. Event when you try to change this method to GET (I assumed), and re-send the event , the request will have following reponse
<html>
<head>
<title>Dead End</title>
</head>

<body bgcolor="#ffffff">
<div style="width: 500px;" align="center">
<br clear="all" />
<p>The link you clicked on is malformed.  Contact the editor of the originating page.</p>
</div>

</body>
</html>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants