ita-social-projects / StreetCode

MIT License
19 stars 9 forks source link

[API] [Admin/News] There is no URL validation when creating news #1117

Open DariaAntonenko opened 9 months ago

DariaAntonenko commented 9 months ago

Environment: OS, Windows 11 . Browser: Google Chrome Version 114.0.5735.135. Reproducible: always Build found: https://github.com/ita-social-projects/StreetCode/commit/d600e2645d9ccf17f6da55c013f00b9705b059d5

Preconditions

  1. Open postman

Steps to reproduce

  1. Make a request to create news
  2. In the "url" line enter URL with invalid data: cyrillic, special symbols(/, @,#,_,$, etc.), capital letters ( for example: "url": "News_нов!№", "/news-news" )
  3. Send a request

Actual result Received a response 200. The news is created. On the user side, when you click on this new, it redirects to a 404 page.

Screenshot_53

https://github.com/ita-social-projects/StreetCode/assets/109734235/ecba6f65-a80b-406a-9c27-024c8fcb07ab

Expected result Received a response 400. The news is not created. This field is allowed to accept: small latin alphabet letters, special symbol "-" and numbers.

User story and test case links E.g.: "User story #835

Labels to be added "Bug", Priority ("pri: hight"), Severity ("severity:hight"), Type ("Functional"), "API"

ChornaOksana commented 6 months ago

image News is still created with invalid data (cyrillic, special symbols, capital letters, e.g. "News_нов!№;"