We use Rest protocol more year.

最近我们尝试使用skywalking作为调用跟踪，结果发现rest协议下的Dubbo-Attachments有限制

"The attachments of RpcContext must not contain  , or = "

我认为这应该是一个bug。没有考虑传入的Attachments的格式。只是简单的用,和=进行分割。
通常在外部调用可能只是像getAttachments().put("contextData", contextDataStr);这样去调用。DataStr的格式只有在rest的时候才有限制。这是不合理的。

异常抛出在
dubbo-rpc/dubbo-rpc-rest/src/main/java/org/apache/dubbo/rpc/protocol/rest/RpcContextFilter.java

是应该修复这个问题吗？

刚和Skywalking的人讨论了一会，认为是协议层不应该有格式上面的限制。

https://github.com/apache/skywalking/issues/3294
}
    @Test
    public void testRestProtocolWithContextPath() {
        DemoServiceImpl server = new DemoServiceImpl();
        Assertions.assertFalse(server.isCalled());
        URL url = URL.valueOf("rest://127.0.0.1:5341/a/b/c?version=1.0.0&interface=org.apache.dubbo.rpc.protocol.rest.DemoService");
        ProviderModel providerModel = new ProviderModel(url.getPathKey(), server, DemoService.class);
        ApplicationModel.initProviderModel(url.getPathKey(), providerModel);
        Exporter<DemoService> exporter = protocol.export(proxy.getInvoker(server, DemoService.class, url));
        url = URL.valueOf("rest://127.0.0.1:5341/a/b/c/?version=1.0.0&interface=org.apache.dubbo.rpc.protocol.rest.DemoService");
        Invoker<DemoService> invoker = protocol.refer(DemoService.class, url);
        DemoService client = proxy.getProxy(invoker);
        String result = client.sayHello("haha");
        Assertions.assertTrue(server.isCalled());
        Assertions.assertEquals("Hello, haha", result);
        invoker.destroy();
        exporter.unexport();
    }
    @Test
    public void testExport() {
        DemoService server = new DemoServiceImpl();
        ProviderModel providerModel = new ProviderModel(exportUrl.getServiceKey(), server, DemoService.class);
        ApplicationModel.initProviderModel(exportUrl.getServiceKey(), providerModel);
        RpcContext.getContext().setAttachment("timeout", "200");
        Exporter<DemoService> exporter = protocol.export(proxy.getInvoker(server, DemoService.class, exportUrl));
        DemoService demoService = this.proxy.getProxy(protocol.refer(DemoService.class, exportUrl));
        Integer echoString = demoService.hello(1, 2);
        assertThat(echoString, is(3));
        exporter.unexport();
    }