File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2422,6 +2422,7 @@ struct HTTP
24222422 import std.algorithm.searching : findSplit, startsWith;
24232423 import std.string : indexOf, chomp;
24242424 import std.uni : toLower;
2425+ import std.exception : assumeUnique;
24252426
24262427 // Wrap incoming callback in order to separate http status line from
24272428 // http headers. On redirected requests there may be several such
@@ -2448,7 +2449,9 @@ struct HTTP
24482449 }
24492450
24502451 auto m = header.findSplit(" : " );
2451- auto fieldName = m[0 ].toLower();
2452+ const (char )[] lowerFieldName = m[0 ].toLower();
2453+ // /Fixes https://issues.dlang.org/show_bug.cgi?id=24458
2454+ string fieldName = lowerFieldName is m[0 ] ? lowerFieldName.idup : assumeUnique(lowerFieldName);
24522455 auto fieldContent = m[2 ].chomp;
24532456 if (fieldName == " content-type" )
24542457 {
You can’t perform that action at this time.
0 commit comments