Remove Webpack dev servers for Boards/Playbooks (#23378)
* Add option to run web app build without dev servers * Completely remove product dev servers * Update unit test * Fix another test
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
e1a2443f1a
Коммит
4cbf6e93d2
@@ -8,7 +8,6 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"os"
|
||||
"reflect"
|
||||
"runtime"
|
||||
"strconv"
|
||||
@@ -132,25 +131,6 @@ func generateDevCSP(c Context) string {
|
||||
}
|
||||
}
|
||||
|
||||
// Add flags for Webpack dev servers used by other products during development
|
||||
if model.BuildNumber == "dev" {
|
||||
boardsURL := os.Getenv("MM_BOARDS_DEV_SERVER_URL")
|
||||
if boardsURL == "" {
|
||||
// Focalboard runs on http://localhost:9006 by default
|
||||
boardsURL = "http://localhost:9006"
|
||||
}
|
||||
|
||||
devCSP = append(devCSP, boardsURL)
|
||||
|
||||
playbooksURL := os.Getenv("MM_PLAYBOOKS_DEV_SERVER_URL")
|
||||
if playbooksURL == "" {
|
||||
// Playbooks runs on http://localhost:9007 by default
|
||||
playbooksURL = "http://localhost:9007"
|
||||
}
|
||||
|
||||
devCSP = append(devCSP, playbooksURL)
|
||||
}
|
||||
|
||||
if len(devCSP) == 0 {
|
||||
return ""
|
||||
}
|
||||
|
||||
@@ -449,7 +449,7 @@ func TestHandlerServeCSPHeader(t *testing.T) {
|
||||
response := httptest.NewRecorder()
|
||||
handler.ServeHTTP(response, request)
|
||||
assert.Equal(t, 200, response.Code)
|
||||
assert.Equal(t, []string{"frame-ancestors 'self'; script-src 'self' cdn.rudderlabs.com js.stripe.com/v3 'unsafe-eval' 'unsafe-inline' http://localhost:9006 http://localhost:9007"}, response.Header()["Content-Security-Policy"])
|
||||
assert.Equal(t, []string{"frame-ancestors 'self'; script-src 'self' cdn.rudderlabs.com js.stripe.com/v3 'unsafe-eval' 'unsafe-inline'"}, response.Header()["Content-Security-Policy"])
|
||||
})
|
||||
|
||||
}
|
||||
@@ -472,7 +472,7 @@ func TestGenerateDevCSP(t *testing.T) {
|
||||
|
||||
devCSP := generateDevCSP(*c)
|
||||
|
||||
assert.Equal(t, " 'unsafe-eval' 'unsafe-inline' http://localhost:9006 http://localhost:9007", devCSP)
|
||||
assert.Equal(t, " 'unsafe-eval' 'unsafe-inline'", devCSP)
|
||||
})
|
||||
|
||||
t.Run("allowed dev flags", func(t *testing.T) {
|
||||
|
||||
Ссылка в новой задаче
Block a user