BeataKr / axios-har-tracker

This library was designed for gathering HAR files from requests sent using axios
https://github.com/BeataKr/axios-har-tracker
10 stars 10 forks source link

capture header and query parameters #8

Closed bewest closed 1 year ago

bewest commented 1 year ago

Very nice library, but I need some changes to make it work. Query parameters were previously formatted as "[object object]". This patch uses qs library to correctly urlencode any remaining query string values.

Correctly capture headers. There is no documented headers.common object, it's a plain object with keys and values. Before this, no headers were recorded.

BeataKr commented 1 year ago

Hi, thank you for contribution. I'll have a look on your code and test changes before merging.

BeataKr commented 1 year ago

Can you please check does 0.5.0 resole your expectations according to the headers?

bewest commented 1 year ago

https://github.com/BeataKr/axios-har-tracker/pull/9 Looks good, thank you. Looks like this will capture request bodies as well? Does HAR output use content or postData, or does it depend on HTTP method? Also note some package/dependency management re, jest, typescript, etc.

BeataKr commented 1 year ago

9 Looks good, thank you. Looks like this will capture request bodies as well? Does HAR output use content or postData, or does it depend on HTTP method? Also note some package/dependency management re, jest, typescript, etc.

Changed in v0.5.0 things https://github.com/BeataKr/axios-har-tracker/pull/9/files#diff-bf2833959cfb84b3c8f83aca5efab3d7e914c9a8ab7be8b9c959d8613d9d0fef

BeataKr commented 1 year ago

v0.5.1 contains raised packs https://github.com/BeataKr/axios-har-tracker/pull/10/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519

BeataKr commented 1 year ago

I'm not able to use axios 1+ due to https://github.com/axios/axios/issues/5183 so would like to postpone this "migration" ;)

BeataKr commented 1 year ago

Think we can close your PR, right?

bewest commented 1 year ago

Wonderful, thanks! Looks good! :rocket: FWIW, since users of axios-har-tracker will be putting axios in their own dependency list, you might consider marking axios as a peerDependency. This will prevent axios getting installed twice when a project depends on axios-har-tracker.