Skip to content

Commit

Permalink
fix(plugins): Use inputstream for reading bodies (#1072)
Browse files Browse the repository at this point in the history
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
robzienert and mergify[bot] authored Feb 23, 2020
1 parent 30f0b59 commit cddc1a1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package com.netflix.spinnaker.gate.services.internal
import com.netflix.spinnaker.fiat.model.resources.ServiceAccount
import retrofit.client.Response
import retrofit.http.*
import retrofit.mime.TypedInput
import retrofit.mime.TypedByteArray

interface Front50Service {
@GET("/credentials")
Expand Down Expand Up @@ -163,11 +163,11 @@ interface Front50Service {
List<Map> getPluginInfo(@Query("service") String service)

@POST("/pluginBinaries/{id}/{version}")
@Headers(["Content-Type: application/zip,application/octet-stream"])
@Headers("Content-Type: application/octet-stream")
Response uploadPluginBinary(
@Path("id") String pluginId,
@Path("version") String pluginVersion,
@Query("sha512sum") String sha512sum,
@Body TypedInput pluginBinary
@Body TypedByteArray pluginBinary
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import com.netflix.spinnaker.gate.services.internal.Front50Service
import io.swagger.annotations.ApiOperation
import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.RequestBody
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RequestParam
import org.springframework.web.bind.annotation.RestController
Expand All @@ -33,12 +32,9 @@ class PluginBinaryController(
) {

@ApiOperation(value = "Upload a plugin binary")
@PostMapping(
"/{pluginId}/{pluginVersion}",
consumes = ["application/zip", "application/octet-stream"]
)
@PostMapping("/{pluginId}/{pluginVersion}")
fun publishBinary(
@RequestBody body: InputStream,
body: InputStream,
@PathVariable pluginId: String,
@PathVariable pluginVersion: String,
@RequestParam sha512sum: String
Expand Down

0 comments on commit cddc1a1

Please sign in to comment.