Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Issues
  • #3615

Closed
Open
Created Apr 16, 2013 by Administrator@rootOwner

Validation webhooks

Created by: joren

The validation on web hooks doesn't really does his job. It only ignores url's that don't start with http or https. But when the url is tested or actually called it failes because URI.parse fails.

I'm not sure what the preferred change is. I could change URI.regexp() with a better regex, use a custom validator or something like http://www.simonecarletti.com/code/publicsuffix/. I'm not really familiar with the style guide of the development but would like to help.

I added 3 test of url's that should fail because it would not be able to be parsed when the webhook gets called.

Failures:

  1) ProjectHook Validations url format 
     Failure/Error: it { should_not allow_value("http://ex_ample.com").for(:url) }
       Expected errors  when url is set to "http://ex_ample.com", got no errors
     # ./spec/models/web_hook_spec.rb:38:in `block (4 levels) in <top (required)>'

  2) ProjectHook Validations url format 
     Failure/Error: it { should_not allow_value("http://example").for(:url) }
       Expected errors  when url is set to "http://example", got no errors
     # ./spec/models/web_hook_spec.rb:39:in `block (4 levels) in <top (required)>'

  3) ProjectHook Validations url format 
     Failure/Error: it { should_not allow_value("http://ex ample").for(:url) }
       Expected errors  when url is set to "http://ex ample", got no errors
     # ./spec/models/web_hook_spec.rb:40:in `block (4 levels) in <top (required)>'
Assignee
Assign to
Time tracking