Skip to content
This repository was archived by the owner on Jul 19, 2019. It is now read-only.

check if id is passed as a query parameter and dont add if it is #115

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@

if req.request_method == 'POST'
# Assume it's well formed
comment = { id: (Time.now.to_f * 1000).to_i }
comment = {}
comment[:id] = (Time.now.to_f * 1000).to_i if !req.query.include?("id")
req.query.each do |key, value|
comment[key] = value.force_encoding('UTF-8')
end
Expand Down