To make sure git_repos displayed on the web are right.
Signed-off-by: Li Yuanchao lyc163mail@163.com --- src/lib/web_backend.rb | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/src/lib/web_backend.rb b/src/lib/web_backend.rb index 91287b4..0bfc6c9 100644 --- a/src/lib/web_backend.rb +++ b/src/lib/web_backend.rb @@ -403,6 +403,8 @@ def query_repos(must, from: 0, size: 1) repos = [] result['hits']['hits'].each do |r| r = r['_source'] + next unless r['git_repo'] =~ /^([a-z0-9]([a-z0-9-_]*[a-z0-9])*(/[a-z0-9][a-z0-9-_]*[a-z0-9]){2})$/ + repos << { git_url: get_repo_url(r['url']), git_repo: r['git_repo']