Uploaded image for project: 'Stanbol'
  1. Stanbol
  2. STANBOL-1349

Report BAD_REQUEST for Enhancer requests using "application/x-www-form-urlencoded"

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 0.12.0
    • Fix Version/s: 1.0.0, 0.12.1
    • Component/s: Enhancer
    • Labels:
      None

      Description

      Sending POST requests to the Stanbol Enhancer without specifying the Content-Type header will likely result in "application/x-www-form-urlencoded" to be used. As this header is also used by the Stanbol default UI the resulting exception is very wired

      java.lang.IllegalArgumentException: The parsed byte array MUST NOT be NULL!
      	org.apache.stanbol.enhancer.servicesapi.impl.ByteArraySource.<init>(ByteArraySource.java:98)
      	org.apache.stanbol.enhancer.servicesapi.impl.ByteArraySource.<init>(ByteArraySource.java:65)
      	org.apache.stanbol.enhancer.servicesapi.impl.StringSource.<init>(StringSource.java:47)
      	org.apache.stanbol.enhancer.servicesapi.impl.StringSource.<init>(StringSource.java:37)
      	org.apache.stanbol.enhancer.jersey.resource.AbstractEnhancerUiResource.enhanceFromForm(AbstractEnhancerUiResource.java:120)
      

      This issue will catch such requests and return a BAD_REQUEST with a description pointing to the missing "Content-Type" header

        Attachments

          Activity

            People

            • Assignee:
              rwesten Rupert Westenthaler
              Reporter:
              rwesten Rupert Westenthaler
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: