Android. Volley. unexpected end of stream on Connection. How to fix?

Please help me to correct the error: unexpected end of stream on Connection{, proxy=DIRECT@ hostAddress= cipherSuite=none protocol=http/1.1} (recycle count=0)

Here is the code sending the request:
private void loadMyInventory() {
 RequestQueue requestQueue = Volley.newRequestQueue(this);
 String url = "";
 JsonObjectRequest request = new JsonObjectRequest(Request.Method.GET, url, null,
 new Response.Listener<jsonobject>() {
 public void onResponse(JSONObject response) {
 Toast.makeText(DepositeActivity.the this response.toString(), Toast.LENGTH_LONG).show();
 }, new Response.ErrorListener() {
 public void onErrorResponse(VolleyError error) {
 Log.d(TAG, "onErrorResponse:" + error.toString());
 }) {
 public Map<string, string> getHeaders() throws AuthFailureError {
 Map<string, string> headers = new HashMap<>();
 headers.put("Steam Auth", getEncodedCredentials());
 return headers;

This error occurs only when adding headers to the request. Tried to send the query is not using the app - everything is fine.
PS Server Node.js maybe there should be something to fix?
July 9th 19 at 10:28
1 answer
July 9th 19 at 10:30
Pretty silly of me: in the method getEncodedCredentials encoded string in base64 and I had mistakenly set the flag Base64.DEFAULT is Base64.NO_WRAP, so I got a string with hyphens.
private String getEncodedCredentials() {
 String result = Base64.encodeToString(credentials.toString().getBytes(), Base64.NO_WRAP);
 Log.d(TAG, "getEncodedCredentials:" + result);
 return result;

Find more questions by tags Android