mirror of
https://github.com/hashicorp/terraform.git
synced 2026-02-03 20:50:59 -05:00
pluginshared: Cleanup request path in tests (#37299)
This commit is contained in:
parent
6740c5e3d1
commit
3e8a08609d
1 changed files with 3 additions and 1 deletions
|
|
@ -9,6 +9,7 @@ import (
|
|||
"net/http"
|
||||
"net/http/httptest"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
|
@ -67,7 +68,8 @@ func (h *testHTTPHandler) Handle(w http.ResponseWriter, r *http.Request) {
|
|||
w.Write([]byte(testManifest))
|
||||
}
|
||||
default:
|
||||
fileToSend, err := os.Open(fmt.Sprintf("testdata/%s", r.URL.Path))
|
||||
path := filepath.Clean(r.URL.Path)
|
||||
fileToSend, err := os.Open(fmt.Sprintf("testdata/%s", path))
|
||||
if err == nil {
|
||||
io.Copy(w, fileToSend)
|
||||
return
|
||||
|
|
|
|||
Loading…
Reference in a new issue