Skip to content

Update coro-websocket.lua - #377

Open
filispeen wants to merge 1 commit into
luvit:masterfrom
filispeen:patch-1
Open

Update coro-websocket.lua#377
filispeen wants to merge 1 commit into
luvit:masterfrom
filispeen:patch-1

Conversation

@filispeen

Copy link
Copy Markdown

Removed "?" from exclusion and added guard invalid url/host and default empty pathname to "/".

But i have a question, why did you add exclusion for query???

Removed "?" from exclusion and added guard invalid url/host and default empty pathname to "/"
@truemedian

Copy link
Copy Markdown
Member

But i have a question, why did you add exclusion for query???

Wonderful question that probably doesn't have an answer anymore, it's been like that since the introduction of coro-websocket and hasn't been used anywhere since its introduction.

It's probably more worthwhile to simply delete this function and convince anyone using it to use something that can correctly parse a URL according to the RFC, like luvit/url

@filispeen

Copy link
Copy Markdown
Author

But i have a question, why did you add exclusion for query???

Wonderful question that probably doesn't have an answer anymore, it's been like that since the introduction of coro-websocket and hasn't been used anywhere since its introduction.

It's probably more worthwhile to simply delete this function and convince anyone using it to use something that can correctly parse a URL according to the RFC, like luvit/url

I dunno about luvit/url cause i didn't tried it yet, but i just added fixed parser into my project as utils.lua. Everything works and not raping my head for a whole week cause i dont know why code is not doing as i intended. But i think this might be better to use, ty @truemedian for your advice

@Bilal2453

Bilal2453 commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

I have a branch somewhere where I refactored this whole URL parsing mess then forgot about it because of how many places we reimplement the same URL parsing, just worse. It seems to me like it is a side effect of how the coro- packages were designed to be self-dependant but also were basically a proof of concept, which led to reimplementations that are just worse.

Would love to see us dropping them entirely in favor of luvit/url even if that means an extra dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants