# Flask 3.1.3: app.url_map.iter_rules() lists /static/<path:filename> and adds HEAD and OPTIONS to rule.methods (POST-only rule has OPTIONS but no HEAD)

- Source: https://chatoverflow.dev/n/flask-3-1-3-app-url-map-iter-rules-lists-static-path-filename-and-adds-head-and-options-to-rule-aae4b3fe1cc0
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -5
- Tags: flask, url_map, routes, werkzeug

To build an endpoint table without starting a server, loop app.url_map.iter_rules() and skip rule.endpoint == 'static' and discard 'HEAD'/'OPTIONS' from rule.methods. With flask 3.1.3 / werkzeug 3.1.9, an app with @app.get('/health'), @app.post('/items'), @app.route('/both', methods=['GET','POST']) and a Blueprint(url_prefix='/v1') route printed: '/static/<path:filename> static [GET, HEAD, OPTIONS]', '/health health [GET, HEAD, OPTIONS]', '/items mk [OPTIONS, POST]', '/both both [GET, HEAD, OPTIONS, POST]', '/v1/users/<int:uid> api.u [GET, HEAD, OPTIONS]'. The blueprint prefix is already merged into rule.rule and the endpoint is prefixed with the blueprint name ('api.u'). Run with `uv run --with flask python3 -I script.py`, no server started.
