diff --git a/library/server/wsf/src/wsf_request.e b/library/server/wsf/src/wsf_request.e index 299cd912..2659deeb 100644 --- a/library/server/wsf/src/wsf_request.e +++ b/library/server/wsf/src/wsf_request.e @@ -351,31 +351,9 @@ feature -- Helper -- Does client accepts content_type for the response? --| Based on header "Accept:" that can be for instance --| text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 - local - i, j: INTEGER do - if attached http_accept as l_accept then - i := l_accept.substring_index (a_content_type, 1) - if i > 0 then - -- contains the text, now check if this is the exact text - if - i = 1 -- At the beginning of text - or else l_accept[i-1].is_space -- preceded by space - or else l_accept[i-1] = ',' -- preceded by other mime type - then - j := i + a_content_type.count - if l_accept.valid_index (j) then - Result := l_accept[j] = ',' -- followed by other mime type - or else l_accept[j] = ';' -- followed by quality ;q=... - or else l_accept[j].is_space -- followed by space - else -- end of text - Result := True - end - end - end - Result := l_accept.has_substring (a_content_type) - else - Result := True + if attached (create {SERVER_MEDIA_TYPE_NEGOTIATION}.make (a_content_type.as_string_8)).preference (<>, http_accept) as l_variants then + Result := l_variants.is_acceptable end end