github-tools / github-tools/github

Allow binary blobs

Aberta
#23 4 comentários 0 reações 0 responsáveis Ver no GitHub
enhancement
Linguagem predominante
JavaScript
Estrelas
3.8k
Forks
809
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

In order to safely transfer binary blobs/filtes, the API needs to use base64 encoding when appropriate. postBlob() however always uses "utf-8". So there needs to be either an additional argument in write() and postBlob() that specifies the encoding, or postBlob() needs to detect if the file is binary or not, and adjust the encoding automatically.

This little snippet seems to be able to detect binary data:

```
/[\x00-\x08\x0E-\x1F]/.test(data)
```

See http://stackoverflow.com/questions/1677644/detect-non-printable-characters-in-javascript

I'm currently dealing with similar issues in Prose: https://github.com/prose/prose/pull/255

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.