grizzly
  1. grizzly
  2. GRIZZLY-998

Incorrect handling of Expect: 100-continue

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0
    • Fix Version/s: 2.1
    • Component/s: http
    • Labels:
      None
    • Environment:

      OpenJDK 1.6.0_20 on Ubuntu 10.10 (curl 7.21.0)

      Description

      The following code from HttpHandler is not doing a spec compliant check for the 100-continue Expect header. The spec calls for matching the literal "100-continue" (lowercase "c") but I would take this to mean that a case-insensitive comparison is permissible.

      This issue can be reproduced on curl by attempting to post a file > 1024 bytes to a grizzly endpoint. It is possible that this limit is dependent on my environment, but the end result is that curl is sending an "Expect: 100-continue" header which is not being matched by the below logic. The result is that Grizzly is responding with a 417 (Expectation Failed) response when it should be responding with a 100 Continue.

      curl -f -X POST --data-binary @my1kplus1file.txt http://localhost:8080/some/endpoint

      protected boolean sendAcknowledgment(final Request request,
      final Response response)
      throws IOException {

      if ("100-Continue".equals(request.getHeader("Expect")))

      { response.setStatus(HttpStatus.CONINTUE_100); response.sendAcknowledgement(); return true; }

      else

      { response.setStatus(HttpStatus.EXPECTATION_FAILED_417); return false; }

      }

        Activity

        Hide
        Ryan Lubke added a comment -

        Changes applied:

        Project: grizzly
        Repository: hg
        Revision: 1691
        Author: rlubke
        Date: 2011-04-13 19:33:44 UTC
        Link:

        Log Message:
        ------------
        Add default exclusion filter from GlassFish.
        Fix for http://java.net/jira/browse/GRIZZLY-998.

        Show
        Ryan Lubke added a comment - Changes applied: Project: grizzly Repository: hg Revision: 1691 Author: rlubke Date: 2011-04-13 19:33:44 UTC Link: Log Message: ------------ Add default exclusion filter from GlassFish. Fix for http://java.net/jira/browse/GRIZZLY-998 .

          People

          • Assignee:
            Ryan Lubke
            Reporter:
            stellalaurenzo
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 30 minutes
              30m
              Remaining:
              Remaining Estimate - 30 minutes
              30m
              Logged:
              Time Spent - Not Specified
              Not Specified