-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong request detection with leading whitespace & non http method #447
Comments
I actually don't use whitespaces before the HTTP method either. I would like to check how Intellij behaves here and act accordingly. I think I would adjust the regex here to only accept uppercase letters. |
Yes. Sounds like a good fix |
So Intellij allows whitespaces, but the request method must be specified with uppercase. I adjust my logic accordingly to avoid false positives. Additionally I add a new switch |
@AnWeber ok, I see. Thanks for Introducing I added it here https://regex101.com/r/XwdLRc/1 I'd assume a single space after the method needs to be enforced (to seperate method and url) so what about
IMHO this would sharpen the parsing and fix my cases? |
on top, a url can't have whitespaces? so you probably could sharpen the matching here too.. I quick found this reference for allowed URL characters: https://www.freecodecamp.org/news/url-encoded-characters-reference/#:~:text=There%20are%20only%20certain%20characters,that%20can%20have%20special%20meanings. |
@rngtng Unfortunately more difficult. The url can also contain variables that maybe allow whitespace. Now I could check if there is a |
I forgot to make the whitespace after the method mandatory. I will add |
Ah right. Forgot about the variables. But imho enforcing a single whitespace would solve it already. With the leading one i can live with. so imho just add the + and remove the force separator to keep it simple? |
The force separator would just be a workaround in case I run into a problem again. But it would also be solvable by creative variables. I remove it again. The |
Perfect. Thanks a lot |
change is released with 6.4.3 |
thanks a lot! |
Hey hey
I'm quite surprised to find out that leading whitespace in front of the http method is supported. Can you elaborate why? IMHO it leads to bad side effects and allow writing (IMHO) rather unreadable code. Like this is a valid syntax:
GET https://httpbin.org/anything
One bad side effect is that then body is dropped in the following:
And even more surprising, it fails with non http method too. This is rendered as three requests:
My expectation is that lines with leading whitespace are not detected as new requests. Same for lines which have start with HTTP method. wyt?
The text was updated successfully, but these errors were encountered: