rokudev / automated-channel-testing

Roku Automated Channel Testing: Selenium-based WebDriver + Robot Framework + JS Framework + Samples
Other
75 stars 38 forks source link

Unable to use POST v1/session/:sessionId/load #27

Open akaikrai opened 3 years ago

akaikrai commented 3 years ago

After sending a zip archive of a build to my roku device I get a "socket hang up" error. After some digging i discovered that it most likely has to do with CORS and strict-origin-when-cross-origin header. I assume that the session drops after attempting to load a zip file from my local machine to the device because of security measures taken to prevent CSRF attacks. Is there a workaround?

aps5431 commented 3 years ago

We are also trying to achieve the same thing. We are tying to call the side load API from Postman and we are getting the following error. 2021/10/20 17:23:35 http: panic serving [::1]:56049: runtime error: invalid memory address or nil pointer dereference goroutine 18 [running]: net/http.(conn).serve.func1() C:/Program Files/Go/src/net/http/server.go:1801 +0xb9 panic({0x7c7140, 0xa56420}) C:/Program Files/Go/src/runtime/panic.go:1047 +0x266 bytes.(Buffer).ReadFrom(0xc000206c00, {0x0, 0x0}) C:/Program Files/Go/src/bytes/buffer.go:204 +0x75 io.copyBuffer({0x87f180, 0xc000206c00}, {0x0, 0x0}, {0x0, 0x0, 0x0}) C:/Program Files/Go/src/io/io.go:409 +0x14b io.Copy(...) C:/Program Files/Go/src/io/io.go:382 httpServer.(Server).GetLoadHandler.func1({0x885490, 0xc00021a0e0}, 0x51d227) C:/Program Files/Go/src/httpServer/handlers.go:232 +0xfa httpServer.Middleware.func1({0x885490, 0xc00021a0e0}, 0xc000206ae0) C:/Program Files/Go/src/httpServer/middleware.go:29 +0x31 net/http.HandlerFunc.ServeHTTP(0xc000222500, {0x885490, 0xc00021a0e0}, 0x100000000000010) C:/Program Files/Go/src/net/http/server.go:2046 +0x2f github.com/gorilla/mux.(Router).ServeHTTP(0xc000152000, {0x885490, 0xc00021a0e0}, 0xc000222400) D:/Discovery/automated-channel-testing-master/pkg/mod/github.com/gorilla/mux@v1.8.0/mux.go:210 +0x1cf net/http.(ServeMux).ServeHTTP(0x0, {0x885490, 0xc00021a0e0}, 0xc000222400) C:/Program Files/Go/src/net/http/server.go:2424 +0x149 net/http.serverHandler.ServeHTTP({0x884670}, {0x885490, 0xc00021a0e0}, 0xc000222400) C:/Program Files/Go/src/net/http/server.go:2878 +0x43b net/http.(conn).serve(0xc0000a8000, {0x8864e0, 0xc000172870}) C:/Program Files/Go/src/net/http/server.go:1929 +0xb08 created by net/http.(*Server).Serve C:/Program Files/Go/src/net/http/server.go:3033 +0x4e8

We have tried with the zip file alone and also the whole path of zip file in the request body. Both are giving the same response. Where is the channel.zip file expected to be while testing using postman .We are not sure where we are going solution. Can someone help.