Aleh Autushka created OLINGO-500:
------------------------------------

             Summary: Batch Body Parsing Issue
                 Key: OLINGO-500
                 URL: https://issues.apache.org/jira/browse/OLINGO-500
             Project: Olingo
          Issue Type: Bug
          Components: odata2-core
    Affects Versions: V2 2.0.1
            Reporter: Aleh Autushka
            Priority: Minor
             Fix For: V2 2.0.1


Hello, I'm facing the next issue:

When I try to execute a simple batch request with advanced rest client:
/MyFormula.svc/$batch

With payload:
--batch
Content-Type: application/http
Content-Transfer-Encoding: binary

GET Cars HTTP/1.1
--batch--

There an error happens:
Expected empty line but was '[None]': line '4'.

I use POST request type and Content-Type: multipart/mixed

This error happens in the method:

public static void consumeBlankLine(final List<Line> remainingMessage, final 
boolean isStrict)
      throws BatchException {
    if (remainingMessage.size() > 0 && 
remainingMessage.get(0).toString().matches("\\s*\r\n\\s*")) {
      remainingMessage.remove(0);
    } else {
      if (isStrict) {
        final int lineNumber = (remainingMessage.size() > 0) ? 
remainingMessage.get(0).getLineNumber() : 0;
        throw new 
BatchException(BatchException.MISSING_BLANK_LINE.addContent("[None]").addContent(lineNumber));
      }
    }
  }

In my case empty line is "\n" and it does not match "\\s*\r\n\\s*".

Thanks




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to