Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-8698

Content-ID of attachments for outgoing requests are URL-decoded instead of URL-encoded

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.2.11, 3.5.1
    • 3.5.4, 3.4.9, 4.0.0, 3.6.0
    • Transports
    • None
    • Unknown

    Description

      We are using camel CXF and we found that for an outgoing request, the Content-ID header of attachments is URL-decoded. We can also see that the Content-ID of incoming requests is also URL-decoded. I would expect that for outgoing requests, the Content-ID would get URL-encoded.

      Code: https://github.com/apache/cxf/blob/master/core/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java#L218

      Stacktrace:

      "main@1" prio=5 tid=0x1 nid=NA runnable
        java.lang.Thread.State: RUNNABLE
         at org.apache.cxf.attachment.AttachmentSerializer.writeHeaders(AttachmentSerializer.java:218)
         at org.apache.cxf.attachment.AttachmentSerializer.writeProlog(AttachmentSerializer.java:182)
         at org.apache.cxf.interceptor.AttachmentOutInterceptor.handleMessage(AttachmentOutInterceptor.java:77)
         at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
         - locked <0x1538> (a org.apache.cxf.phase.PhaseInterceptorChain)
         at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:532)
         at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:441)
         at org.apache.camel.component.cxf.CxfProducer.process(CxfProducer.java:170)
         at org.apache.camel.impl.SynchronousDelegateProducer.process(SynchronousDelegateProducer.java:62)
         at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
         at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:148)
         at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:548)
         at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201)
         at org.apache.camel.processor.Pipeline.process(Pipeline.java:138)
         at org.apache.camel.processor.Pipeline.process(Pipeline.java:101)
         at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201)
         at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:76)
         at org.apache.camel.processor.SharedCamelInternalProcessor.process(SharedCamelInternalProcessor.java:186)
         at org.apache.camel.processor.SharedCamelInternalProcessor.process(SharedCamelInternalProcessor.java:86)
         at org.apache.camel.impl.ProducerCache$1.doInProducer(ProducerCache.java:541)
         at org.apache.camel.impl.ProducerCache$1.doInProducer(ProducerCache.java:506)
         at org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:369)
         at org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:506)
         at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:229)
         at org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:144)
         at org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:161)
         at org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:370)
         at soap12.Client.sendMessage(Client.java:24)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-1)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
         at java.lang.reflect.Method.invoke(Method.java:498)
         at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
         at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
         at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
         at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
         at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
         at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
         at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
         at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
         at org.junit.rules.RunRules.evaluate(RunRules.java:20)
         at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
         at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
         at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
         at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
         at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
         at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
         at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
         at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
         at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
         at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
         at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230)
         at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58)

      Attachments

        Issue Links

          Activity

            People

              reta Andriy Redko
              mash-sap Manuel Shenavai
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: