Skip to content

Commit

Permalink
Fix non-editable HTTP header grid due to missing contructor on Custom…
Browse files Browse the repository at this point in the history
…Headers class
  • Loading branch information
christianhelle committed Jan 21, 2025
1 parent 8749475 commit a5c85e4
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,22 @@ public AddCustomHeaderDialog(

foreach (var keyValuePair in existingHeaders)
bindingList.Add(
new CustomHeader(keyValuePair.Key,keyValuePair.Value));
new CustomHeader
{
Key = keyValuePair.Key,
Value = keyValuePair.Value
});
}

public IReadOnlyDictionary<string, string> CustomHeaders
=> bindingList
.Where(c => !string.IsNullOrWhiteSpace(c.Key) && !string.IsNullOrWhiteSpace(c.Value))
.ToDictionary(k => k.Key, v => v.Value);

private sealed record CustomHeader(string Key, string Value)
private sealed class CustomHeader
{
public string Key { get; } = Key;
public string Value { get; } = Value;
public string Key { get; set; }
public string Value { get; set; }
}
}
}

0 comments on commit a5c85e4

Please sign in to comment.