shopware / k6-shopware

E2E Performance Testing with Grafana K6
https://developer.shopware.com/docs/guides/hosting/performance/k6.html
15 stars 5 forks source link

Redirect handling in postFormData #8

Closed tomnoir closed 2 months ago

tomnoir commented 2 months ago

The regex to extract the domain part of the URL seems to miss domain parts if there are several (e.g. subdomain):

https://github.com/shopware/k6-shopware/blob/3a3fc0e0e545ecfffd26f0e6f133a8e3b427863e/helpers/util.js#L37

An improved regex could be /(https?:\/\/(?:[\w-]+\.)+[\w-]+(?::\d+)?)/g

Otherwise thanks to everybody for the amazing K6 scenario!

shyim commented 2 months ago

Your regex does not match just localhost :)

tomnoir commented 2 months ago

Oh you're right 🙈

Thanks for the quick fix!