Skip to content

Commit

Permalink
Multipart zio#1559
Browse files Browse the repository at this point in the history
  • Loading branch information
fokot committed Oct 31, 2022
1 parent 416bf2c commit b59d90d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion zio-http/src/main/scala/zio/http/Body.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package zio.http
import io.netty.buffer.{ByteBuf, ByteBufUtil, Unpooled}
import io.netty.channel.{DefaultFileRegion, Channel => JChannel}
import io.netty.handler.codec.http.{FullHttpRequest, LastHttpContent}
import io.netty.handler.codec.http.multipart.{HttpPostMultipartRequestDecoder, InterfaceHttpData}
import io.netty.handler.codec.http.multipart.HttpPostMultipartRequestDecoder
import io.netty.util.AsciiString
import zio._
import zio.http.model.{HTTP_CHARSET, Multipart}
Expand Down
2 changes: 1 addition & 1 deletion zio-http/src/main/scala/zio/http/MultipartConverter.scala
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package zio.http

import io.netty.handler.codec.http.multipart._
import zio.{RIO, Scope, ZIO}
import zio.http.model.Multipart
import zio.http.model.Multipart.{Attribute, FileUpload}
import zio.stream.ZStream
import zio.{RIO, Scope, ZIO}

import java.nio.file.Paths

Expand Down
8 changes: 2 additions & 6 deletions zio-http/src/main/scala/zio/http/model/Multipart.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ sealed trait Multipart {
def length: Long

/**
* Returns the defined length of the HttpData.
* Returns the defined bytes length of the HttpData.
*
* If no Content-Length is provided in the request, the defined length is
* always 0 (whatever during decoding or in final state).
Expand All @@ -17,12 +17,8 @@ sealed trait Multipart {
* length. This value does not change, whatever during decoding or in the
* final state.
*
* This method could be used for instance to know the amount of bytes
* transmitted for one particular HttpData, for example one {@link FileUpload}
* or any known big {@link Attribute}.
*
* @return
* the defined length of the HttpData
* the defined bytes length of the HttpData
*/
def definedLength: Long
def charset: String
Expand Down

0 comments on commit b59d90d

Please sign in to comment.