diff --git a/Sora/Sora.cs b/Sora/Sora.cs index c7309b2..3ff3197 100644 --- a/Sora/Sora.cs +++ b/Sora/Sora.cs @@ -50,7 +50,10 @@ public enum SpotlightFocusRidType R1, R2, } - + public class Header + { + public List content { get; set; } = new List(); + } public class DataChannel { // 以下は設定必須 @@ -62,7 +65,8 @@ public class DataChannel public int? MaxRetransmits; public string? Protocol; public bool? Compress; - public string? Header; + public Header? Header; + } public const string ActionBlock = "block"; @@ -457,7 +461,7 @@ public void Connect(Config config) } if (m.Header != null) { - c.SetHeader(m.Header); + c.SetHeader(new SoraConf.Internal.Header { content = new List(m.Header.content) }); } cc.data_channels.Add(c); } diff --git a/src/sora.cpp b/src/sora.cpp index 1b20c9a..28d495e 100644 --- a/src/sora.cpp +++ b/src/sora.cpp @@ -421,8 +421,11 @@ void Sora::DoConnect(const sora_conf::internal::ConnectConfig& cc, } if (dc.has_header()) { const auto& header_content = dc.header.content; - d.header->insert(d.header->end(), header_content.begin(), - header_content.end()); + d.header->reserve(header_content.size()); + for (const auto& json_str : header_content) { + auto parsed = boost::json::parse(json_str); + d.header->push_back(std::move(parsed)); + } } config.data_channels.push_back(std::move(d)); }