           return callback(@hookHandlerError) if @hookHandlerError
 
           @validateTransaction test, transaction, callback
-
-
-    if transaction.request['body'] and @isMultipart requestOptions
-      @replaceLineFeedInBody transaction, requestOptions
 
     try
       @performRequest(requestOptions, handleRequest)

        transaction.test = test
        return callback()

  isMultipart: (requestOptions) ->
    caseInsensitiveRequestHeaders = {}
    for key, value of requestOptions.headers
      caseInsensitiveRequestHeaders[key.toLowerCase()] = value
    caseInsensitiveRequestHeaders['content-type']?.indexOf("multipart") > -1

  replaceLineFeedInBody: (transaction, requestOptions) ->
    if transaction.request['body'].indexOf('\r\n') == -1
      transaction.request['body'] = transaction.request['body'].replace(/\n/g, '\r\n')
      transaction.request['headers']['Content-Length'] = Buffer.byteLength(transaction.request['body'], 'utf8')
      requestOptions.headers = transaction.request['headers']


module.exports = TransactionRunner

  # An actual HTTP request, before validation hooks triggering
  # and the response validation is invoked here
  performRequestAndValidate: (test, transaction, hooks, callback) ->
    if transaction.request.body and @isMultipart(transaction.request.headers)
      transaction.request.body = @fixApiBlueprintMultipartBody(transaction.request.body)

    @setContentLength(transaction)
    requestOptions = @getRequestOptionsFromTransaction(transaction)

