OWASP-BLT / BLT-Flutter

The official OWASP BLT App repository/ Heist 'em bugs!
https://owasp.org/www-project-bug-logging-tool/
BSD 3-Clause "New" or "Revised" License
22 stars 29 forks source link

URL hint is unclear while reporting an issue #364

Closed MrunalrajRedij closed 6 months ago

MrunalrajRedij commented 6 months ago

In report screen, in a first textfield it gives hint as App name / URL. So I typed as it is, app name after slash the url of an app example: xyz / https://www.xyz.com But report form only accepts a valid URL as an input. Otherwise there is will be an exception returning Enter valid URL

While creating an issue I got that URL exception msg and I immediately thought it was an image uploading issue. Turns out images were working fine, single as well as multiple. But It was me who was entering incorrect URL.

Can we give more clear hints? or a separate textfields for app name and URL?

Dante291 commented 6 months ago

Hey i think you got it all wrong, it is basically either type the name of the app or its URL.

MrunalrajRedij commented 6 months ago

With this logic It should also take xyz / https://www.xyz.com as it is a string. And, I tried giving only app name and it gave me Enter valid URL exception with status code: 400.

MrunalrajRedij commented 6 months ago

I looked at the code. report_bug.dart: line 910

Issue issue = Issue(
                      ...
                      url: _titleController.text,
                      title: _titleController.text,
                      ...
                    );

So even if we input only app name, we are assigning it to the url field. There is no check happening for valid URL and condition to assign it to url field, if valid URL. And then server is returning the error because it is not a valid URL.

Dante291 commented 6 months ago

bro add http:// too in the url and it will work fine

MrunalrajRedij commented 6 months ago

That's what I am asking. So it's compulsory to give include https:// ? And one should not input only app name?

Dante291 commented 6 months ago

yes for valid URL you need to add https:// also for app name i guess we need to correct it as currently we are using only URL to identify on what platform bug is occuring.

MrunalrajRedij commented 6 months ago

bro add http:// too in the url and it will work fine

Sorry, I think I am not describing my issue properly. Looking at hint given, it looks like I can type either app name or URL as you too perviously mentioned.

But inputting app name alone will give an Invalid URL error from server. I don't think this is intended. Is it?

Dante291 commented 6 months ago

Yeah gotta fix it, it should be only URL and onFocus hint text should be an example URL starting with https://

do you wanna work on this? or should i fix this?

MrunalrajRedij commented 6 months ago

yes for valid URL you need to add https:// also for app name i guess we need to correct it as currently we are using only URL to identify on what platform bug is occuring.

Okay, got it so URL is mandatory. I mean it's not too big on an issue but should the hint be remain as it is or changed? Also can we make two separate fields for app name and URL? I am guessing it will also require changing backend too.

MrunalrajRedij commented 6 months ago

I wanna work on this

MrunalrajRedij commented 6 months ago

/assign

Dante291 commented 6 months ago

yes for valid URL you need to add https:// also for app name i guess we need to correct it as currently we are using only URL to identify on what platform bug is occuring.

Okay, got it so URL is mandatory. I mean it's not too big on an issue but should the hint be remain as it is or changed? Also can we make two separate fields for app name and URL? I am guessing it will also require changing backend too.

For now fix this only

Dante291 commented 6 months ago

@DonnieBLT Close this issue as it is completed.