Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-1770

In resteasy-client.js do not use JSON.stringify on entity of type FormData

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 3.5.0.CR1, 4.0.0.Beta2
    • 4.0.0.Beta2
    • jaxrs
    • None

    Description

      In resteasy-jsapi/src/main/resources/resteasy-client.js line 111
      allows a entity of type FormData to be "stringify". The community says this is not good.

      }else if(this.entity instanceof Object){
         if(!contentTypeSet || REST._isJSONMIME(contentTypeSet))
      	data = JSON.stringify(this.entity);
      }
      

      The code should be

      }else if(this.entity instanceof Object && !(this.entity instanceof FormData)){
       	if(!contentTypeSet || REST._isJSONMIME(contentTypeSet))
       		data = JSON.stringify(this.entity);
      }
      

      Attachments

        Activity

          People

            rsearls r searls
            rsearls r searls
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: