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

Returns null when response code 304 is send by a website #630

Closed
KrystianMalecki opened this issue Dec 26, 2020 · 2 comments
Closed

Returns null when response code 304 is send by a website #630

KrystianMalecki opened this issue Dec 26, 2020 · 2 comments
Labels
area-Core This affects CC's core (the Lua runtime, APIs, computer internals). bug A problem or unexpected behaviour with the mod. invalid Issues caused by user error, another mod, etc...

Comments

@KrystianMalecki
Copy link

I'm trying to get responses from my web page and i'm receiving response code 304. (it is hosted on Vercel so i don't know how to change response code)
This code is blocked in HttpRequestHandler on line 238.

 private URI getRedirect( HttpResponseStatus status, HttpHeaders headers )
    {
        int code = status.code();
        if( code < 300 || code > 307 || code == 304 || code == 306 ) return null;

Is it an intended feature or is it just a bug?

@KrystianMalecki KrystianMalecki added the bug A problem or unexpected behaviour with the mod. label Dec 26, 2020
@SquidDev SquidDev added area-Core This affects CC's core (the Lua runtime, APIs, computer internals). cannot reproduce I'm unable to reproduce this bug. labels Dec 27, 2020
@SquidDev
Copy link
Member

SquidDev commented Dec 27, 2020

I'm afraid I cannot reproduce this. I just created a small local server, and 304 requests are returned as expected:

http working with 304 responses

The getRedirect function is used to process Location headers, which are not valid for HTTP requests returning 304. If this function returns null, normal processing of the request should continue below.


Worth noting that that code is incorrect. We should handle 201, 301, 302, 303, 307, 308 responses, not whatever this mishmash is. Not sure why this code is like this, but it shouldn't be causing this bug either way.

@KrystianMalecki
Copy link
Author

KrystianMalecki commented Dec 27, 2020

Oh sanp, i misinterpreted it what it means. The error is on my side. Sorry for bothering you

@SquidDev SquidDev added invalid Issues caused by user error, another mod, etc... and removed cannot reproduce I'm unable to reproduce this bug. labels Dec 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Core This affects CC's core (the Lua runtime, APIs, computer internals). bug A problem or unexpected behaviour with the mod. invalid Issues caused by user error, another mod, etc...
Projects
None yet
Development

No branches or pull requests

2 participants