Julian Reschke created SLING-7021:
-------------------------------------

             Summary: incorrect content coding check in TopologyRequestValidator
                 Key: SLING-7021
                 URL: https://issues.apache.org/jira/browse/SLING-7021
             Project: Sling
          Issue Type: Bug
          Components: Extensions
            Reporter: Julian Reschke
            Priority: Minor


Nitpicking...

{noformat}
        final String contentEncoding = request.getHeader("Content-Encoding");
        if (contentEncoding!=null && contentEncoding.contains("gzip")) {
            // then treat the request body as gzip:
            final GZIPInputStream gzipIn = new 
GZIPInputStream(request.getInputStream());
            final String gunzippedEncodedJson = IOUtils.toString(gzipIn);
            gzipIn.close();
            return gunzippedEncodedJson;
{noformat}

"contains" is wrong here, it would match the following field values:
{noformat}
nogzip
gzip, gzip
deflate, gzip
gzip2
{noformat}

... none of which should match. The simplest fix would be to trim the value and 
check for {{equals("gzip")}}.




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to