Skip to content
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

HTTPRequest get_body_size() returns -1 in HTML5 #87141

Open
JMedina90 opened this issue Jan 13, 2024 · 7 comments
Open

HTTPRequest get_body_size() returns -1 in HTML5 #87141

JMedina90 opened this issue Jan 13, 2024 · 7 comments

Comments

@JMedina90
Copy link

JMedina90 commented Jan 13, 2024

Tested versions

v3.5.3.stable.official [6c81413]

System information

MacOS Sonoma 14.1.2.
Browser tested: Chrome, Firefox.

Issue description

When calling the HTTPRequest.get_body_size() function, it returns -1 only in HTML5, while it works as expected in MacOS.

Steps to reproduce

Call the function in get_body_size() while in HTML5.

Minimal reproduction project (MRP)

N/A

@AThousandShips
Copy link
Member

Does the call to request return OK?

@JMedina90
Copy link
Author

Yes, the call returns OK.

@bitsawer
Copy link
Member

In Godot 4.x on Web / HTML5 platform we always return -1 for technical reasons, see #79846. I guess similar limitations also apply to Godot 3. This seems to be explicitly documented for Godot 4, but not Godot 3.

@JMedina90
Copy link
Author

Okay, I see! Thank you.

@AThousandShips
Copy link
Member

This should still be tracked and documented, please leave it open until solved

@Mickeon
Copy link
Contributor

Mickeon commented Jan 26, 2024

Actually this is documented in 3.x (future 3.6) but has not been retroactively added to 3.5 .

[b]Note:[/b] Some Web servers may not send a body length. In this case, the value returned will be [code]-1[/code]. If using chunked transfer encoding, the body length will also be [code]-1[/code].

@AThousandShips
Copy link
Member

That is unrelated, that's about the servers sending packets to the client, not the platform of Godot, this is already in 3.5 (it was added five years ago)

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

No branches or pull requests

5 participants