Skip to content

Commit f647ec1

Browse files
committed
Disallow repeated headers.
1 parent 68b5f20 commit f647ec1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

libsolidity/lsp/Transport.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,11 @@ optional<map<string, string>> IOStreamTransport::parseHeaders()
131131

132132
string name = boost::to_lower_copy(line.substr(0, delimiterPos));
133133
string value = line.substr(delimiterPos + 1);
134-
headers[boost::trim_copy(name)] = boost::trim_copy(value);
134+
if (!headers.emplace(
135+
boost::trim_copy(name),
136+
boost::trim_copy(value)
137+
).second)
138+
return nullopt;
135139
}
136140
return {move(headers)};
137141
}

0 commit comments

Comments
 (0)