Skip to content

Commit 3631784

Browse files
committed
Fix date filter over JSON-RPC: send Time/Date as ISO 8601 string
YAML parses date strings as Time objects. Time responds to to_liquid, so DropProxy.wrap was wrapping it as an RPC drop. The server's RpcDropProxy is not a Time, so the date filter couldn't format it. Fix: add Time/Date/DateTime cases to wrap that send iso8601 string. The date filter parses the string on the server side. JSON-RPC: 4286 passes, 6 failures (down from 9), 992 skipped. Remaining 6: 4 filesystem error messages, 2 resource limits.
1 parent 34b13b9 commit 3631784

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

lib/liquid/spec/json_rpc/drop_proxy.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ def wrap(obj, registry, seen = {}.compare_by_identity)
7272
else
7373
obj
7474
end
75+
when Time
76+
# Time is a valid Liquid value but can't be JSON-encoded.
77+
# Send as ISO 8601 string — the date filter can parse it.
78+
obj.iso8601
79+
when Date, DateTime
80+
obj.iso8601
7581
when Symbol
7682
# Symbols can't be faithfully represented in JSON.
7783
# Send a _ruby_type marker so the server can optionally

0 commit comments

Comments
 (0)