METHOD-001PASS
GET /static/style.css - Erlaubte Methode
Beispielanfrage
curl -X GET http://localhost:8080/static/style.cssGET-Anfragen an statische Dateien sind laut Policy erlaubt. Die Anfrage wird an das Backend weitergeleitet.
8 Tests verifizieren, dass nur erlaubte HTTP-Methoden pro Pfad akzeptiert werden.
HTTP-Methoden werden pro Pfad in policy.yaml konfiguriert:
# policy.yaml
paths:
- pattern: "/static/*"
methods: ["GET", "HEAD"]
- pattern: "/api/users"
methods: ["GET", "POST"]
- pattern: "/api/users/{id}"
methods: ["GET", "PUT", "DELETE"]
# Global: Gefährliche Methoden blockieren
blocked_methods:
- "TRACE" # XST-Angriffe verhindern
- "CONNECT" # Proxy-Missbrauch verhinderncurl -X GET http://localhost:8080/static/style.cssGET-Anfragen an statische Dateien sind laut Policy erlaubt. Die Anfrage wird an das Backend weitergeleitet.
curl -X POST -d '{"name": "Max"}' http://localhost:8080/api/usersPOST-Anfragen an /api/users sind zum Erstellen neuer Benutzer erlaubt.
curl -X DELETE http://localhost:8080/static/style.cssHTTP/1.1 405 Method Not Allowed
Allow: GET, HEAD
{"error": "Methode nicht erlaubt", "allowed": ["GET", "HEAD"]}DELETE-Anfragen an statische Dateien werden blockiert. Die Antwort enthält den Allow-Header mit erlaubten Methoden.
curl -X TRACE http://localhost:8080/api/usersTRACE und andere potenziell gefährliche Methoden werden standardmäßig blockiert, um XST-Angriffe (Cross-Site Tracing) zu verhindern.