Skip to content

Commit e50157d

Browse files
committed
Ensure Ruby server doesn't have duplicate id fields in json
Alternative approach to reactjs#115
1 parent 6e6ff3a commit e50157d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
# Assume it's well formed
2626
comment = { id: (Time.now.to_f * 1000).to_i }
2727
req.query.each do |key, value|
28-
comment[key] = value.force_encoding('UTF-8')
28+
comment[key] = value.force_encoding('UTF-8') unless key == 'id'
2929
end
3030
comments << comment
3131
File.write(

0 commit comments

Comments
 (0)