Http Abstractions for parsing Http headers needed for conneg

Moved from http abstractions.
Not sure why we are fussing about this temporary code?

-----Original Message-----
From: "Ryan Nowak" <notifications@github.com>
Sent: ‎7/‎21/‎2014 10:25 PM
To: "aspnet/Mvc" <Mvc@noreply.github.com>
Cc: "Yishai Galatzer" <yishai_galatzer@yahoo.com>
Subject: Re: [Mvc] Http Abstractions for parsing Http headers needed forconneg (#806)

In src/Microsoft.AspNet.Mvc.HeaderValueAbstractions/MediaTypeHeaderValue.cs:
> +
> +        public static MediaTypeHeaderValue Parse(string input)
> +        {
> +            if(string.IsNullOrEmpty(input))
> +            {
> +                return null;
> +            }
> +
> +            var inputArray = input.Split(new[] { ';' }, 2);
> +            var mediaTypeParts = inputArray[0].Split('/');
> +            if(mediaTypeParts.Length != 2)
> +            {
> +                return null;
> +            }
> +
> +            // TODO: throw if the media type and subtypes are invalid.
What's the reason why you can't just do this now?
—
Reply to this email directly or view it on GitHub.