Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions octokit.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -791,15 +791,17 @@ makeOctokit = (newPromise, allPromises, XMLHttpRequest, base64encode, userAgent)
# Post a new blob object, getting a blob SHA back
# -------
@postBlob = (content, isBase64) ->
if typeof (content) is 'string'
# Base64 encode the content if it is binary (isBase64)
content = base64encode(content) if isBase64

if isBase64
content =
content: content
encoding: 'utf-8'

content.encoding = 'base64' if isBase64
content: content,
encoding: 'base64'
else
if typeof (content) is 'string'
# Base64 encode the content if it is binary (isBase64)
content = base64encode(content) if isBase64
content =
content: content
encoding: 'utf-8'

_request('POST', "#{_repoPath}/git/blobs", content)
.then (res) =>
Expand Down
20 changes: 12 additions & 8 deletions octokit.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.