grafana / k6-jslib-aws

Javascript Library allowing to interact with AWS resources from k6 scripts
Apache License 2.0
18 stars 29 forks source link

Omitting the `path` property in the `sign` method's first argument should use a default value instead #48

Open oleiade opened 1 year ago

oleiade commented 1 year ago

As reported by a user , when one omits to set the path property of the sign method first argument, it leads to an error:

ERRO[0000] TypeError: Cannot read property 'split' of undefined or null
        at value (webpack://k6-jslib-aws/./src/internal/signature.ts:404:37(12))
        at value (webpack://k6-jslib-aws/./src/internal/signature.ts:300:40(32))
        at value (webpack://k6-jslib-aws/./src/internal/signature.ts:146:40(213))
        at file:///.../k6-script.js:207:2(53)  executor=per-vu-iterations scenario=default source=stacktrace

We should probably make this property optional and use a default value instead, as it's quite common for requests to not need to override the path.