mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 18:56:05 +02:00
Use match? instead of match
for regex where MatchData is unused
This commit is contained in:
parent
db08ad7125
commit
82dbd3e8b8
7 changed files with 12 additions and 10 deletions
|
@ -29,7 +29,7 @@ module Repp
|
|||
# example: curl -u registrar1:password localhost:3000/repp/v1/domains/1/transfer_info -H "Auth-Code: authinfopw1"
|
||||
get '/:id/transfer_info', requirements: { id: /.*/ } do
|
||||
ident = params[:id]
|
||||
domain = ident =~ /\A[0-9]+\z/ ? Domain.find_by(id: ident) : Domain.find_by_idn(ident)
|
||||
domain = ident.match?(/\A[0-9]+\z/) ? Domain.find_by(id: ident) : Domain.find_by_idn(ident)
|
||||
|
||||
error! I18n.t('errors.messages.epp_domain_not_found'), 404 unless domain
|
||||
error! I18n.t('errors.messages.epp_authorization_error'), 401 unless domain.transfer_code.eql? request.headers['Auth-Code']
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue