@@ -228,32 +228,3 @@ func TestFormatBearerToken(t *testing.T) {
228228 t .Errorf ("expected result to start with 'Authorization: Bearer ', got %q" , result )
229229 }
230230}
231-
232- func TestAuthenticationMiddleware_ContainerMode (t * testing.T ) {
233- // Set container environment variable
234- os .Setenv ("DOCKER_MCP_IN_CONTAINER" , "1" )
235- defer os .Unsetenv ("DOCKER_MCP_IN_CONTAINER" )
236-
237- authToken := "test-token-123"
238- handler := http .HandlerFunc (func (w http.ResponseWriter , _ * http.Request ) {
239- w .WriteHeader (http .StatusOK )
240- _ , _ = w .Write ([]byte ("success" ))
241- })
242-
243- secured := authenticationMiddleware (authToken , handler )
244-
245- // Should allow request without auth token when in container mode
246- req := httptest .NewRequest (http .MethodPost , "/mcp" , nil )
247- // No Authorization header
248-
249- rr := httptest .NewRecorder ()
250- secured .ServeHTTP (rr , req )
251-
252- if rr .Code != http .StatusOK {
253- t .Errorf ("Expected 200 in container mode, got %d" , rr .Code )
254- }
255-
256- if rr .Body .String () != "success" {
257- t .Errorf ("Expected 'success', got %q" , rr .Body .String ())
258- }
259- }
0 commit comments