@@ -149,7 +149,7 @@ private static async Task<bool> IsValidContentTypeHeaderAsync(HttpContext contex
149149 await FlushResponseAsync ( context , new Error ( HttpStatusCode . UnsupportedMediaType )
150150 {
151151 Title = "The specified Content-Type header value is not supported." ,
152- Detail = $ "Please specify '{ Constants . ContentType } ' for the Content-Type header value."
152+ Detail = $ "Please specify '{ HeaderConstants . ContentType } ' for the Content-Type header value."
153153 } ) ;
154154
155155 return false ;
@@ -159,7 +159,7 @@ private static async Task<bool> IsValidContentTypeHeaderAsync(HttpContext contex
159159
160160 private static async Task < bool > IsValidAcceptHeaderAsync ( HttpContext context )
161161 {
162- if ( context . Request . Headers . TryGetValue ( Constants . AcceptHeader , out StringValues acceptHeaders ) == false )
162+ if ( context . Request . Headers . TryGetValue ( HeaderConstants . AcceptHeader , out StringValues acceptHeaders ) == false )
163163 return true ;
164164
165165 foreach ( var acceptHeader in acceptHeaders )
@@ -172,7 +172,7 @@ private static async Task<bool> IsValidAcceptHeaderAsync(HttpContext context)
172172 await FlushResponseAsync ( context , new Error ( HttpStatusCode . NotAcceptable )
173173 {
174174 Title = "The specified Accept header value is not supported." ,
175- Detail = $ "Please specify '{ Constants . ContentType } ' for the Accept header value."
175+ Detail = $ "Please specify '{ HeaderConstants . ContentType } ' for the Accept header value."
176176 } ) ;
177177 return false ;
178178 }
@@ -184,19 +184,19 @@ private static bool ContainsMediaTypeParameters(string mediaType)
184184 var incomingMediaTypeSpan = mediaType . AsSpan ( ) ;
185185
186186 // if the content type is not application/vnd.api+json then continue on
187- if ( incomingMediaTypeSpan . Length < Constants . ContentType . Length )
187+ if ( incomingMediaTypeSpan . Length < HeaderConstants . ContentType . Length )
188188 {
189189 return false ;
190190 }
191191
192- var incomingContentType = incomingMediaTypeSpan . Slice ( 0 , Constants . ContentType . Length ) ;
193- if ( incomingContentType . SequenceEqual ( Constants . ContentType . AsSpan ( ) ) == false )
192+ var incomingContentType = incomingMediaTypeSpan . Slice ( 0 , HeaderConstants . ContentType . Length ) ;
193+ if ( incomingContentType . SequenceEqual ( HeaderConstants . ContentType . AsSpan ( ) ) == false )
194194 return false ;
195195
196196 // anything appended to "application/vnd.api+json;" will be considered a media type param
197197 return (
198- incomingMediaTypeSpan . Length >= Constants . ContentType . Length + 2
199- && incomingMediaTypeSpan [ Constants . ContentType . Length ] == ';'
198+ incomingMediaTypeSpan . Length >= HeaderConstants . ContentType . Length + 2
199+ && incomingMediaTypeSpan [ HeaderConstants . ContentType . Length ] == ';'
200200 ) ;
201201 }
202202
0 commit comments