[GH-ISSUE #1157] When importing a .har file, timestamps that do not contain fractional seconds fail to import and change to the current time #1153

Open
opened 2026-03-03 19:48:47 +03:00 by kerem · 8 comments
Owner

Originally created by @IMNilesAZ on GitHub (Feb 24, 2022).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/1157

Originally assigned to: @NghiaTranUIT on GitHub.

It appears that the way you are parsing timestamps when importing .har files requires a fractional second part (even if it is .0). According to ISO-8601 and RFC 3339, fractional seconds should be optional. When I import a .har file with timestamps that do not have fractional seconds (no decimal), they import as "now".

Proxyman version? (Ex. Proxyman 1.4.3)

3.1.0

macOS Version? (Ex. mac 10.14)

12.2

Steps to reproduce

import .HAR file that contains timestamps that do NOT have fractional seconds

Expected behavior

timestamps are imported correctly instead of turning into "current time"

Screenshots (optional)

Originally created by @IMNilesAZ on GitHub (Feb 24, 2022). Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/1157 Originally assigned to: @NghiaTranUIT on GitHub. It appears that the way you are parsing timestamps when importing .har files requires a fractional second part (even if it is .0). According to ISO-8601 and RFC 3339, fractional seconds should be optional. When I import a .har file with timestamps that do not have fractional seconds (no decimal), they import as "now". ### Proxyman version? (Ex. Proxyman 1.4.3) 3.1.0 ### macOS Version? (Ex. mac 10.14) 12.2 ### Steps to reproduce import .HAR file that contains timestamps that do NOT have fractional seconds ### Expected behavior timestamps are imported correctly instead of turning into "current time" ### Screenshots (optional)
Author
Owner

@NghiaTranUIT commented on GitHub (Feb 25, 2022):

Hey @IMNilesAZ You're correct. Proxyman only accepts ISO-8601 with fractional seconds. We decide to use it because the latest Charles Proxy, Google Chrome, and Safari use it when exporting as a HAR file.

In the older version of Proxyman, we use ISO-8601 without fractional seconds, and it's incompatible with another apps. Hence, we update the format.

Just wondering: Which application that you use to export a HAR file (which doesn't have the decimal)? 🤔

We'd like to understand the context and might support both kinds of time formats.

<!-- gh-comment-id:1050431657 --> @NghiaTranUIT commented on GitHub (Feb 25, 2022): Hey @IMNilesAZ You're correct. Proxyman only accepts `ISO-8601` with fractional seconds. We decide to use it because the latest Charles Proxy, Google Chrome, and Safari use it when exporting as a HAR file. In the older version of Proxyman, we use `ISO-8601` without fractional seconds, and it's incompatible with another apps. Hence, we update the format. Just wondering: Which application that you use to export a HAR file (which doesn't have the decimal)? 🤔 We'd like to understand the context and might support both kinds of time formats.
Author
Owner

@IMNilesAZ commented on GitHub (Feb 25, 2022):

It’s a custom tool, actually, so as it happens I can easily fix it (the tool actually creates .trace files, which Charles will also happily convert to a .har file). I believe, though, that irrespective of the tool, ISO-8601 specifies that the fractional seconds are optional. So, even if the current versions tools you know about work, you’re still open to failure if the fractions are ever omitted. Hopefully you can adjust your date formatter to allow for the presence or absence of the fractional seconds and then you’ll be covered.

<!-- gh-comment-id:1050471570 --> @IMNilesAZ commented on GitHub (Feb 25, 2022): It’s a custom tool, actually, so as it happens I can easily fix it (the tool actually creates .trace files, which Charles will also happily convert to a .har file). I believe, though, that irrespective of the tool, ISO-8601 specifies that the fractional seconds are *optional*. So, even if the current versions tools you know about work, you’re still open to failure if the fractions are ever omitted. Hopefully you can adjust your date formatter to allow for the presence or absence of the fractional seconds and then you’ll be covered.
Author
Owner

@NghiaTranUIT commented on GitHub (Feb 25, 2022):

If you don't mind, can you share with me a sample HAR file that I can test?

<!-- gh-comment-id:1050472255 --> @NghiaTranUIT commented on GitHub (Feb 25, 2022): If you don't mind, can you share with me a sample HAR file that I can test?
Author
Owner

@NghiaTranUIT commented on GitHub (Feb 25, 2022):

@IMNilesAZ let try this beta build: https://proxyman.s3.us-east-2.amazonaws.com/beta/Proxyman_3.1.0_Fix_HAR_Timeformat.dmg

Proxyman now supports a standard ISO-8601 with or without the second decimal 👍

<!-- gh-comment-id:1050546514 --> @NghiaTranUIT commented on GitHub (Feb 25, 2022): @IMNilesAZ let try this beta build: https://proxyman.s3.us-east-2.amazonaws.com/beta/Proxyman_3.1.0_Fix_HAR_Timeformat.dmg Proxyman now supports a standard ISO-8601 with or without the second decimal 👍
Author
Owner

@IMNilesAZ commented on GitHub (Feb 25, 2022):

Sure will try it out today, thanks!

<!-- gh-comment-id:1050838784 --> @IMNilesAZ commented on GitHub (Feb 25, 2022): Sure will try it out today, thanks!
Author
Owner

@IMNilesAZ commented on GitHub (Feb 28, 2022):

sorry, got busy. Will try to test this today

<!-- gh-comment-id:1054426878 --> @IMNilesAZ commented on GitHub (Feb 28, 2022): sorry, got busy. Will try to test this today
Author
Owner

@IMNilesAZ commented on GitHub (Mar 1, 2022):

Looks like it works, thanks.

I do notice now, by the way, that when a certain timestamp is missing (in my case, it looks like the response start time was missing), it gets reported as "the current time" -- maybe it should be left out or set to some other connection-relevant time instead? Not sure. not a big deal, in any case, it doesn't impact my use case.

As it happens, the tool I'm using actually generates a charles .trace file, so before I can open it in proxyman I have to first use the charles conversion tool to convert it to .har, and then proxyman opens that. It would be handy if proxyman would allow me to open not only .chls files but also any other file the charles converter is capable of converting (notably '.trace'), since it already supports using the converter to open .chls files :). Could be as simple as allowing the .trace extension.

Cheers

<!-- gh-comment-id:1055913040 --> @IMNilesAZ commented on GitHub (Mar 1, 2022): Looks like it works, thanks. I do notice now, by the way, that when a certain timestamp is _missing_ (in my case, it looks like the response start time was missing), it gets reported as "the current time" -- maybe it should be left out or set to some other connection-relevant time instead? Not sure. not a big deal, in any case, it doesn't impact my use case. As it happens, the tool I'm using actually generates a charles .trace file, so before I can open it in proxyman I have to first use the charles conversion tool to convert it to .har, and then proxyman opens that. It would be handy if proxyman would allow me to open not only .chls files but also any other file the charles converter is capable of converting (notably '.trace'), since it already supports using the converter to open .chls files :). Could be as simple as allowing the .trace extension. Cheers
Author
Owner

@NghiaTranUIT commented on GitHub (Mar 2, 2022):

I do notice now, by the way, that when a certain timestamp is missing (in my case, it looks like the response start time was missing), it gets reported as "the current time" -

You're right. I have to change it. By default, if one of these data is absent, it will use the current time, which is incorrect.

Thanks. I will open a ticket for supporting the *.trace file 👍

<!-- gh-comment-id:1056026449 --> @NghiaTranUIT commented on GitHub (Mar 2, 2022): > I do notice now, by the way, that when a certain timestamp is missing (in my case, it looks like the response start time was missing), it gets reported as "the current time" - You're right. I have to change it. By default, if one of these data is absent, it will use the current time, which is incorrect. Thanks. I will open a ticket for supporting the `*.trace` file 👍
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Proxyman#1153
No description provided.