         }
         do {
             var t = tail
-            while t.first?.unicodeScalars.hasSPHTPrefix ?? false {
+            while t.first?.unicodeScalars[...].hasSPHTPrefix ?? false {
                 guard let (h2, t2) = t.decompose else { return nil }
                 t = t2
-                guard let v = h2.unicodeScalars.trimSPHTPrefix else { return nil }
+                guard let v = h2.unicodeScalars[...].trimSPHTPrefix else { return nil }
                 let valuePart = String(v)
                 value = value.map { $0 + " " + valuePart } ?? valuePart
             }

    }
    /// Unicode scalars after removing the leading spaces (SP) and horizontal tabs (HT).
    /// Returns `nil` if the unicode scalars do not start with a SP or HT.
    var trimSPHTPrefix: String.UnicodeScalarView? {
        guard !isEmpty else { return nil }
        var idx = startIndex
        while idx < endIndex {

    /// Split a request line into its 3 parts: *Method*, *Request-URI*, and *HTTP-Version*.
    /// - SeeAlso: https://tools.ietf.org/html/rfc2616#section-5.1
    func splitRequestLine() -> (String, String, String)? {
        let scalars = self.unicodeScalars[...]
        guard let firstSpace = scalars.rangeOfSpace else { return nil }
        let remainingRange = firstSpace.upperBound..<scalars.endIndex
        let remainder = scalars[remainingRange]
