GitLab steht aufgrund wichtiger Wartungsarbeiten am Montag, den 8. März, zwischen 17:00 und 19:00 Uhr nicht zur Verfügung.

Commit b1784438 authored by Robert Schilling's avatar Robert Schilling Committed by Kamil Trzciński

Add support for FTP assets for releases

Extend the list of supported protocols to include FTP.
parent 2b68d0cd
......@@ -6,7 +6,7 @@ class Link < ActiveRecord::Base
belongs_to :release
validates :url, presence: true, url: true, uniqueness: { scope: :release }
validates :url, presence: true, url: { protocols: %w(http https ftp) }, uniqueness: { scope: :release }
validates :name, presence: true, uniqueness: { scope: :release }
scope :sorted, -> { order(created_at: :desc) }
title: Add support for FTP assets for releases
merge_request: 25071
author: Robert Schilling
type: added
......@@ -3,6 +3,7 @@
> [Introduced]( in GitLab 11.7.
Using this API you can manipulate GitLab's [Release](../../user/project/releases/ links. For manipulating other Release assets, see [Release API](
GitLab supports links links to `http`, `https`, and `ftp` assets.
## Get links
......@@ -77,4 +77,28 @@
it { be_truthy }
describe 'supported protocols' do
where(:protocol) do
%w(http https ftp)
with_them do
let(:link) { build(:release_link, url: protocol + '://') }
it 'will be valid' do
expect(link).to be_valid
describe 'unsupported protocol' do
context 'for torrent' do
let(:link) { build(:release_link, url: 'torrent://') }
it 'will be invalid' do
expect(link).to be_invalid
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment