File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
main/groovy/io/seqera/wave/controller
test/groovy/io/seqera/wave/controller Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -28,8 +28,10 @@ import io.micronaut.core.annotation.Nullable
28
28
import io.micronaut.http.HttpRequest
29
29
import io.micronaut.http.HttpResponse
30
30
import io.micronaut.http.HttpStatus
31
+ import io.micronaut.http.annotation.Body
31
32
import io.micronaut.http.annotation.Controller
32
33
import io.micronaut.http.annotation.Get
34
+ import io.micronaut.http.annotation.Post
33
35
import io.micronaut.http.annotation.QueryValue
34
36
import io.micronaut.http.client.HttpClient
35
37
import io.micronaut.http.client.annotation.Client
@@ -315,8 +317,8 @@ class ViewController {
315
317
* @return
316
318
* The redirect response to the scan view for the requested container image
317
319
*/
318
- @Get (' /scans' )
319
- Publisher<HttpResponse > requestScan (@QueryParam String image ) {
320
+ @Post (' /scans' )
321
+ Publisher<HttpResponse > requestScan (@Body String image ) {
320
322
final req = new SubmitContainerTokenRequest (containerImage : image, scanMode : ScanMode . required)
321
323
final post = HttpRequest . POST (" /v1alpha2/container" , req)
322
324
final resp = httpClient. retrieve(post, SubmitContainerTokenResponse )
Original file line number Diff line number Diff line change @@ -790,8 +790,8 @@ class ViewControllerTest extends Specification {
790
790
def image = " ubuntu:latest"
791
791
and :
792
792
def req = java.net.http.HttpRequest . newBuilder()
793
- .GET ()
794
- .uri(new URI (" ${ uri} /view/scans?image= ${ image } " ))
793
+ .POST ( java.net.http.HttpRequest.BodyPublishers . ofByteArray(image . bytes))
794
+ .uri(new URI (" ${ uri} /view/scans" ))
795
795
.build()
796
796
797
797
when :
You can’t perform that action at this time.
0 commit comments