{"action":"created","issue":{"url":"https://api.github.com/repos/danikula/AndroidVideoCache/issues/132","repository_url":"https://api.github.com/repos/danikula/AndroidVideoCache","labels_url":"https://api.github.com/repos/danikula/AndroidVideoCache/issues/132/labels{/name}","comments_url":"https://api.github.com/repos/danikula/AndroidVideoCache/issues/132/comments","events_url":"https://api.github.com/repos/danikula/AndroidVideoCache/issues/132/events","html_url":"https://github.com/danikula/AndroidVideoCache/issues/132","id":222343573,"number":132,"title":"Can't work in Farsi。","user":{"login":"flztsj","id":5946178,"avatar_url":"https://avatars2.githubusercontent.com/u/5946178?v=3","gravatar_id":"","url":"https://api.github.com/users/flztsj","html_url":"https://github.com/flztsj","followers_url":"https://api.github.com/users/flztsj/followers","following_url":"https://api.github.com/users/flztsj/following{/other_user}","gists_url":"https://api.github.com/users/flztsj/gists{/gist_id}","starred_url":"https://api.github.com/users/flztsj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flztsj/subscriptions","organizations_url":"https://api.github.com/users/flztsj/orgs","repos_url":"https://api.github.com/users/flztsj/repos","events_url":"https://api.github.com/users/flztsj/events{/privacy}","received_events_url":"https://api.github.com/users/flztsj/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2017-04-18T08:45:08Z","updated_at":"2017-04-18T10:05:21Z","closed_at":null,"body":"We test it fail when user choose the system language to Farsi.\r\n\r\nNeed modify the code and add Locale.US for String.format function :\r\n\r\n    private String newResponseHeaders(GetRequest request) throws IOException, ProxyCacheException {\r\n        String mime = source.getMime();\r\n        boolean mimeKnown = !TextUtils.isEmpty(mime);\r\n        int length = cache.isCompleted() ? cache.available() : source.length();\r\n        boolean lengthKnown = length >= 0;\r\n        long contentLength = request.partial ? length - request.rangeOffset : length;\r\n        boolean addRange = lengthKnown && request.partial;\r\n        return new StringBuilder()\r\n                .append(request.partial ? \"HTTP/1.1 206 PARTIAL CONTENT\\n\" : \"HTTP/1.1 200 OK\\n\")\r\n                .append(\"Accept-Ranges: bytes\\n\")\r\n                .append(lengthKnown ? String.format(Locale.US, \"Content-Length: %d\\n\", contentLength) : \"\")\r\n                .append(addRange ? String.format(Locale.US, \"Content-Range: bytes %d-%d/%d\\n\", request.rangeOffset, length - 1, length) : \"\")\r\n                .append(mimeKnown ? String.format(Locale.US, \"Content-Type: %s\\n\", mime) : \"\")\r\n                .append(\"\\n\") // headers end\r\n                .toString();\r\n    }"},"comment":{"url":"https://api.github.com/repos/danikula/AndroidVideoCache/issues/comments/294760550","html_url":"https://github.com/danikula/AndroidVideoCache/issues/132#issuecomment-294760550","issue_url":"https://api.github.com/repos/danikula/AndroidVideoCache/issues/132","id":294760550,"user":{"login":"flztsj","id":5946178,"avatar_url":"https://avatars2.githubusercontent.com/u/5946178?v=3","gravatar_id":"","url":"https://api.github.com/users/flztsj","html_url":"https://github.com/flztsj","followers_url":"https://api.github.com/users/flztsj/followers","following_url":"https://api.github.com/users/flztsj/following{/other_user}","gists_url":"https://api.github.com/users/flztsj/gists{/gist_id}","starred_url":"https://api.github.com/users/flztsj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flztsj/subscriptions","organizations_url":"https://api.github.com/users/flztsj/orgs","repos_url":"https://api.github.com/users/flztsj/repos","events_url":"https://api.github.com/users/flztsj/events{/privacy}","received_events_url":"https://api.github.com/users/flztsj/received_events","type":"User","site_admin":false},"created_at":"2017-04-18T10:05:21Z","updated_at":"2017-04-18T10:05:21Z","body":"you can check the value of responseHeaders"}}
{"actor":{"display_login":"flztsj"}}