-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
- Loading branch information
There are no files selected for viewing
7 comments
on commit 3f32f79
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a hack dude, not a proper fix. ;)
You probably would like to parse it (using Time.parse_iso8601
or similar) if it's a String
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Sija I got into a situation where I get
exception: Invalid number at 0: ">>Fri, 07 Aug 2020 08:50:48 GMT" (Time::Format::Error)
Which is not ISO8601, so it's either I do analysis for each ISO, or I just say "allow it to be string, and if it's string just nil it"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bararchy Yeah, but that's because you have a malformed string at your side - you should fix it before parsing it as a HAR
file instead of pushing a responsibility for handling such cases to a generic lib like this.
Which is not ISO8601, so it's either I do analysis for each ISO, or I just say "allow it to be string, and if it's string just nil it"
That's not defined by any RFC or other document I know, so you just insert random business-logic into this shard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Sija this lib should make sure to support the common HAR generators, chrome, firefox, charles, edge, IE, opera, selenium, cypressIO, etc..
From my POV we need to make sure to parse those HARs successfully, and make sure that non-fatal issues are handled.
This seems to be a constant issue from charles, same as not putting anything in the body and instead wrap it in the "parameters" section, like chrome putting stuff automatically nilable and not by the standard, strings that can be suddenly Int, Int that becomes arrays or objects.
the HAR "rfc" is a big flaming mess, I want to make sure Crystal users can digest and handle those as best as they could.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Sija this lib should make sure to support the common HAR generators, chrome, firefox, charles, edge, IE, opera, selenium, cypressIO, etc..
From my POV we need to make sure to parse those HARs successfully, and make sure that non-fatal issues are handled.
@bararchy Good point, but for that I'd recommend adding appropriate HAR files into the specs (and keeping them up to date).
the HAR "rfc" is a big flaming mess, I want to make sure Crystal users can digest and handle those as best as they could.
Fair 'nuff, but dropping values is IMO not "as best as they could".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"as best as they could"
If you have a better idea let me know :) I just wanted that to pass and parse, the ability to create an actual cookie is less meaningful then having the actual data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bararchy Hard to come up with the actual solution without knowing the data, but I'd probably create a custom converter or sth in that vein.
There's no need for that since
HTTP::Cookie#expires
is of a typeTime?
anyway.