Closed kristian-lange closed 9 years ago
-1
Any explanation for your '-1'? Maybe it's just plain stupid, but I just can't see it.
From my point of view the har-reader works correct. Maybe the writer of the shouldn't write NaNs. Which piece of software do you use to write the Har?
Sorry, I didn't want to imply your software works incorrectly.
The problem here is just that these NaNs happen in the wild and we can't change it. It might not be how your and mine definition of good data or code is but they are there.
I'm using Firebug and NetExport.
Maybe Sebastian will merge my PullRequest. This could solve our Problem.
Thank you!
I've released version 1.1.0 - it may take some time, until it is synced to maven central.
Now you are able to set a "lax mode" and ignore invalid date fields:
Har har = HarReader.fromFile(harFile, HarReaderMode.LAX); // Lax mode -> ignoring invalid date formats
Har har = HarReader.fromFile(harFile); // Strict mode / old behaviour
Thanks to @maxbraun for the implementation!
Regards, Sebastian
It's working like a charm!
Sometimes cookies' expires value is in a weird format, e.g. I get on a webpage
Unfortunately har-reader throws an exception in theses cases:
de.sstoehr.harreader.HarReaderException: com.fasterxml.jackson.databind.exc.InvalidFormatException: Can not construct instance of java.util.Date from String value 'NaN-NaN- NaNTNaN:NaN:NaN.NaN+NaN:NaN': not a valid representation (error: Failed to parse Date value 'NaN-NaN-NaNTNaN:NaN:NaN.NaN+NaN:NaN': Can not parse date "NaN-NaN-NaNTNaN:NaN:NaN.NaN+NaN:NaN": not compatible with any of standard forms ("yyyy-MM-dd'T'HH:mm:ss.SSSZ", "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", "EEE, dd MMM yyyy HH:mm:ss zzz", "yyyy-MM-dd"))
Is it possible to let har-reader just ignore weirdly formated expires values?