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

Add support for status code 530 #15

Closed

Conversation

ruimarinho
Copy link

Cloudflare returns a 530 if there is a DNS error on the origin. Not really sure how to classify this other than "unofficial". It is a common FTP code, but on an FTP context it means "Not logged in". I'm open to suggestions.

Source: https://support.cloudflare.com/hc/en-us/articles/234979888-Error-1016-Origin-DNS-error

@dougwilson
Copy link
Contributor

Are you sure the status message for this is "Site is frozen"? No where in the entire article you sent are those words used, so I'm skeptical. Can you show the output of a curl -i against a URL that is returning a 530 from Cloudflare?

Also may help if you add a little bit more background around why you're trying to get the code added to the list here as well, especially since it's not IANA and because it's adding an entire new category :)

@dougwilson dougwilson added the pr label Oct 19, 2017
@dougwilson dougwilson self-assigned this Oct 19, 2017
@ruimarinho
Copy link
Author

I am not. I don't have the actual status text and that one was sourced from errorcodelist.com. It might be interesting to add the other Unofficial ones if that's a category you would like to entertain.

I'm currently working on setting up an invalid domain on Cloudflare to obtain the status text, as I'm curious about it as well.

As to the why, with Cloudflare becoming an important backbone of content delivery on the internet, the chance of receiving a response with this status code is increasing. If proxying this response to a koa app (for whatever reasons there might be to do so), it will fail due to this check.

@dougwilson
Copy link
Contributor

Yea, but all those lists show 530 that a site called Pantheon returns (which is the "Site is frozen") and has no relation to Cloudflare's 530.

This module is not meant to categorize all possible statues code from all providers, especially when they conflict. 530 is a conflicting one, because both Pantheon and Cloudflare are using it for different purposes. How can we possibly add it to this module in that condition?

For the Koa check, this has been discussed here a few times, and in the end I don't understand what the purpose of that check is. The HTTP spec clearly states that any code in the format /[12345][0-9]{2}/ is 100% valid, and a reverse proxy shouldn't be constrained to a very restrictive set -- you have no idea what the upstream is going to send, since any code, even unregistered codes are 100% valid.

@ruimarinho
Copy link
Author

ruimarinho commented Oct 20, 2017

Can you show the output of a curl -i against a URL that is returning a 530 from Cloudflare?

No status text is sent. I thought it was an issue with logging :-)

HTTP/1.1 530
Date: Thu, 19 Oct 2017 23:03:34 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: close
Set-Cookie: __cfduid=foobar; expires=Fri, 19-Oct-18 23:03:34 GMT; path=/; domain=foo.bar; HttpOnly
Cache-Control: max-age=6
Expires: Thu, 19 Oct 2017 23:03:40 GMT
X-Frame-Options: SAMEORIGIN
Server: cloudflare-nginx

<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]-->
<!--[if IE 7]>    <html class="no-js ie7 oldie" lang="en-US"> <![endif]-->
<!--[if IE 8]>    <html class="no-js ie8 oldie" lang="en-US"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en-US"> <!--<![endif]-->
<head>
<title>Origin DNS error | foobar.com | Cloudflare</title></title>
…

This module is not meant to categorize all possible statues code from all providers, especially when they conflict.

Right, I understand your point, but at the same it's a pretty subjective line (which I respect) - but it's difficult to compare different dimensions (apache vs Cloudflare). I think that given the fact that no status text is included, it doesn't make sense to include it in the module as that's part of its functionality.

How can we possibly add it to this module in that condition?

Just a note on this one - I guess that can happen with any code unassigned in IANA. 418, 425 and 509 can be introduced in a new web framework at any time and each represent something different than what's been included in the module.

For the Koa check, this has been discussed here a few times, and in the end I don't understand what the purpose of that check is. [...] you have no idea what the upstream is going to send, since any code, even unregistered codes are 100% valid

I think this is a very valid point and I agree that this validation should be removed from koa. It seems like this has been discussed before on this repository one way or another, although I believed 530 had more widespread usage than what further evidence proved in the meantime.

Thanks for your time and patience!

@ruimarinho ruimarinho closed this Oct 20, 2017
@ruimarinho ruimarinho deleted the enhancement/status-530 branch October 20, 2017 00:51
@dougwilson
Copy link
Contributor

Yea, I mean, every boundary for any module is going to be subjective to the original author. If not, then why shouldn't all of this, including even Koa just be part of Node.js directly? There is a subjective line that divides these apart.

Ultimately I'm just trying to remove everything that just isn't driven by the IANA list, but also the subjective line for the codes included here are just for lookups, mainly for server responses. The .redirect, .retry, and .empty maps are the pretty useful items of the module, and certainly anything not added to those don't really have much value, especially because you can easily read the status message that goes with the code from the response itself (I know in this case it's an empty string, but I guess that's what Cloudflare wants).

Conflicts are the hardest thing to manage, and the IANA has an entire process to resolve that, and I would rather create a module that is programatic to the IANA registry rather than become a registry myself, including all the issues that go along with that like conflict resolution.

Ultimately if you are passing a reverse proxy though this module for validation as your use-case, I don't think that use-case ultimately makes sense, and that adding 530 would just fix this one issue, but you'll still end up with other codes appearing all of a sudden.

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

Successfully merging this pull request may close these issues.

2 participants