Skip to content

Commit

Permalink
Add IO flush to builder finish methods
Browse files Browse the repository at this point in the history
  • Loading branch information
straight-shoota committed Jun 15, 2020
1 parent 68f0f38 commit 152159d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/http/formdata/builder.cr
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ module HTTP::FormData
@io << "\r\n--" << @boundary << "--"

@state = :FINISHED
@io.flush
end

private def generate_content_disposition(name, metadata)
Expand Down
1 change: 1 addition & 0 deletions src/json/builder.cr
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class JSON::Builder
when DocumentEndState
# okay
end
@io.flush
end

def document
Expand Down
1 change: 1 addition & 0 deletions src/mime/multipart/builder.cr
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ module MIME::Multipart
end

@state = :FINISHED
@io.flush
end

private def fail(msg)
Expand Down
1 change: 1 addition & 0 deletions src/yaml/builder.cr
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class YAML::Builder
# Ends a YAML stream.
def end_stream
emit stream_end
@io.flush
end

# Starts a YAML stream, invokes the block, and ends it.
Expand Down

0 comments on commit 152159d

Please sign in to comment.