Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-8625

camel-restlet - Form fields overwrite headers in InMessage

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Won't Fix
    • 2.13.4, 2.14.2, 2.15.1
    • Future
    • camel-restlet
    • None
    • Linux

    • Unknown

    Description

      DefaultRestletBinding adds values from submitted form as headers in the inMessage of the exchange. As a result it is close to impossible to rely on any of the values provided.
      Suggested solution:
      a) form values should be stored separately, or
      b) populating headers from the form should fail if a header with this key already exists
      c) prefixing keys coming from the form with something, for instance "form."

      Solution a is a safer solution which will break compatibility with previous versions of Apache Camel (it can also be spread over a number of releases, first introducing new field for form values and logging a warning if form data is being extracted, next making it configurable and disabled by default, then removing this functionality).
      Solution b is backwards compatible if this behaviour is not used as a feature (if it is, it should not). That said someone could still use it to populate RestletRequest-like headers in the Message.
      Solution c would be rather ok as well, but I like a more, personally.

      I can provide a patch if any solution is accepted.

      Attachments

        1. FormParameter.java
          0.7 kB
          Wouter Blancquaert
        2. DefaultRestletBindingFixed.java
          14 kB
          Wouter Blancquaert

        Activity

          People

            Unassigned Unassigned
            tptak Tomasz Ptak
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: