-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Description
The repo_info endpoint in api/index.py creates a Graph(repo) and calls g.stats() without first checking graph_exists(repo):
@app.route('/api/repo_info', methods=['POST'])
@public_access
@token_required
def repo_info():
data = request.get_json()
repo = data.get('repo')
if repo is None:
return jsonify({'status': 'Missing mandatory parameter "repo"'}), 400
g = Graph(repo) # No graph_exists() check
stats = g.stats()
info = get_repo_info(repo)
...Other endpoints like graph_entities, get_neighbors, and find_paths all check graph_exists(repo) before proceeding.
Suggested Fix
Add the same guard:
if not graph_exists(repo):
return jsonify({'status': f'Missing project {repo}'}), 400Context
Found during code review of PR #522.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working