Skip to content

Commit 4c901a5

Browse files
committed
Update external_resources.rb
1 parent 11a915c commit 4c901a5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

app/models/strain/external_resources.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ def external_strain_info_api(action, acc, empty = [])
7777
body = external_request(uri)
7878
return empty unless body.present?
7979

80+
# Pre-processing to avoid a strange StrainInfo bug returning malformed JSON
81+
body.gsub!(/,,+/, ',')
82+
body.gsub!(/^\[,/, '[')
83+
body.gsub!(/,\]$/, ']')
8084
JSON.parse(body)
8185
end
8286
end

0 commit comments

Comments
 (0)