-
Notifications
You must be signed in to change notification settings - Fork 33
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
Improve UX of HAR converter's output scripts #117
Comments
Another thing we should improve is the handling of special/non-printable characters in the generated scripts. For example, instead of having an invisible null-byte in the middle of a random string, we'd be better of if the string contained |
Regarding request bodies, we can check the |
As seen in this issue, another reason for massively refactoring (i.e. rewriting) the HAR converter is the somewhat poor request dependency detection in the current implementation |
@na-- I ❤️ this idea; this is a great improvement of the Because the issue is quite big and most of the above changes are "independent" improvements of the current API, I think the issue could be splitted into several issues which could be handled separately; this structure could make easier to start, delegate the work and see the progress on the goal. This approach is used in other OSS projects, for example: emberjs/ember.js#16927 and ember-cli/ember-cli#7530. |
We shouldn't add the
|
I moved this from the k6 repo, since this was originally meant for the built-in We're currently working on a new HTTP API (initial design document), so it's best if this work is done after the new API is implemented. |
With some refactoring and a few new features we can make the k6 HAR converter produce much more readable and user-friendly scripts without loosing anything in correctness or functionality. Some of the things I think can be changed:
user-agent
header to the globaloptions
object and remove it from each request (unless for some reason it's different than the global, though that should basically never happen with HAR files)host
header by default (i.e. for example by adding a new--remove-headers
option in the HAR converter that by default hashost
in it)connection
header when its value iskeep-alive
, since that's what the default HTTP 1.1 value is is that's what k6 does by defaultaccept-encoding
headers (arguable if we should remove it, but I think since it's super dependent on the HTTP client, we actually should clear it by default, because it's totally possible for a web-browser to put encodings there that we don't support in k6, thereby causing a bug)--correlate
or something like that), don't save it inres
http.batch()
call to actually just usehttp.request()
or evenhttp.get()
/http.post()
/etc. callsaccept
http header by default, since I think it doesn't usually do all that much and is almost universally ignored by servers, while adding messiness to the codeuserAgent
, if we had the general option we can also use it for other headers that are basically the same for every request in a HAR file, like theAccept-Language
(andAccept-Encoding
, if we decide it's not worth removing it).Referer
header) and factor them outGenerally I'd like if generated scripts go from looking like this:
to something more like this:
The text was updated successfully, but these errors were encountered: