<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/apache/dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/apache/dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: 2.7.6</li>
<li>Operating System version:  Windows 10</li>
<li>Java version: JDK 1.8</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ul dir="auto">
<li>Configure provider's protocol to http and using <code class="notranslate">RpcContext.getContext().setAttachment()</code> to pass implicit parameters to provider.</li>
<li>Provider unable to get the attachment.</li>
</ul>
<h3 dir="auto">Possible Reason</h3>
<p dir="auto">There is any wrong wit the code used to pass implicit parameters in http protocol.</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/apache/dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/apache/dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: 2.7.2</li>
<li>Operating System version: Ubuntu 18.04</li>
<li>Java version: 1.8</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<p dir="auto">Method <code class="notranslate">base642bytes(String)</code> and other overloaded methods only check the length of the input <code class="notranslate">String</code>, not its content. Currently, passing an invalid <code class="notranslate">String</code> to this method causes it to return an unpredictble result. For example:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import org.apache.dubbo.common.io.Bytes;

public class Testing {

    public static void main(String[] args) {
        System.out.println(Bytes.bytes2base64(Bytes.base642bytes(&quot;d=u=b=bo&quot;)));
	System.out.println(Bytes.bytes2base64(Bytes.base642bytes(&quot;invalid&quot;)));
    }
}
"><pre class="notranslate"><code class="notranslate">import org.apache.dubbo.common.io.Bytes;

public class Testing {

    public static void main(String[] args) {
        System.out.println(Bytes.bytes2base64(Bytes.base642bytes("d=u=b=bo")));
	System.out.println(Bytes.bytes2base64(Bytes.base642bytes("invalid")));
    }
}

</code></pre></div>
<h3 dir="auto">Expected Result</h3>
<p dir="auto"><code class="notranslate">IllegalArgumentException</code> for the first call.</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">Prints <code class="notranslate">//v///bo</code> for the first call and throws an <code class="notranslate">IllegalArgumentException</code> for the second call, even though both calls pass an invalid <code class="notranslate">String</code>.</p>
<p dir="auto">Ideally, <code class="notranslate">base642bytes(String)</code> throws an <code class="notranslate">IllegalArgumentException</code> whenever an invalid input <code class="notranslate">String</code> is passed. This can be achieved by checking each character individually, which is highly inefficient, or by updating the documentation explaining under what conditions an <code class="notranslate">IllegalArgumentException</code> is thrown.</p>