Skip to content

Commit

Permalink
Merge pull request #8 from ovcharenko-di/feature/error-msg
Browse files Browse the repository at this point in the history
Feature/error msg
  • Loading branch information
ovcharenko-di authored Apr 14, 2021
2 parents b811d10 + 9b85330 commit 1c3c7fb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions conf.d/crserver-filter.conf
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ server {

-- проверка на пустой комментарий
if message == nil then
ngx.status = ngx.HTTP_BAD_REQUEST
ngx.header.content_type = 'text/plain; charset=utf-8'
ngx.say("ОТСУТСТВУЕТ КОММЕНТАРИЙ")
ngx.exit(ngx.HTTP_BAD_REQUEST)
end

Expand All @@ -58,6 +61,12 @@ server {
if (five_digits ~= nil or no_task ~= nil) and double_n ~= nil then
return
else
ngx.status = ngx.HTTP_BAD_REQUEST
ngx.header.content_type = 'text/plain; charset=utf-8'
ngx.say("НЕВЕРНЫЙ ФОРМАТ КОММЕНТАРИЯ")
ngx.say("комментарий должен:")
ngx.say("- начинаться на #12345 (где 12345 - номер задачи) или на #нетзадачи")
ngx.say("- содержать пустую строку, отделяющую заголовок комментария от тела")
ngx.exit(ngx.HTTP_BAD_REQUEST)
end

Expand Down

1 comment on commit 1c3c7fb

@Bezeus
Copy link

@Bezeus Bezeus commented on 1c3c7fb Apr 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Огонь! Прям когда нужно. Спасибо!

Please sign in to comment.