feat(platform): expose amap server readiness
This commit is contained in:
@@ -62,6 +62,7 @@ func TestWithRequestTimeoutReturnsEnvelopeWithTraceID(t *testing.T) {
|
||||
func TestAppConfigScriptIsRuntimeRendered(t *testing.T) {
|
||||
handler := withAppConfig(http.NotFoundHandler(), config.Config{
|
||||
AMapWebJSKey: "web-key",
|
||||
AMapAPIKey: "server-api-key",
|
||||
AMapSecurityCode: "security-code",
|
||||
AMapServiceHost: "/_AMapService",
|
||||
})
|
||||
@@ -82,8 +83,8 @@ func TestAppConfigScriptIsRuntimeRendered(t *testing.T) {
|
||||
t.Fatalf("app config script missing %q: %s", want, body)
|
||||
}
|
||||
}
|
||||
if strings.Contains(body, "security-code") || strings.Contains(body, "amapSecurityJsCode") {
|
||||
t.Fatalf("app config script should not expose AMap security code: %s", body)
|
||||
if strings.Contains(body, "security-code") || strings.Contains(body, "server-api-key") || strings.Contains(body, "amapSecurityJsCode") || strings.Contains(body, "amapApiKey") {
|
||||
t.Fatalf("app config script should not expose server-side AMap secrets: %s", body)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user