Skip to content

Commit

Permalink
Check version param present
Browse files Browse the repository at this point in the history
  • Loading branch information
n8ta committed Mar 3, 2024
1 parent 01acf10 commit bebfff6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/controllers/mofs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ def api

# GET /version
def version
unless params.has_key?(:version)
return render json: { status: RESULTS[:error], error: "You must supply a version/git-hash parameter for this api. Eg. /mofs/version?version=xyz" }, status: 500
end
version = params[:version].strip
url = "https://github.com/snurr-group/mofdb-x-archive/tree/"
redirect_to url + version, allow_other_host: true
Expand Down

0 comments on commit bebfff6

Please sign in to comment.