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
Include the "scheme" in self links #77
Include the "scheme" in self links #77
Conversation
Thanks for contribute with this fix. Just as stated, the change is RFC compliant, so we will work on it to release it as soon as possible. |
In order to complete the proposal, the commit 5f251bb has been made to consider that the server can be behind a proxy/balancer. Now the scheme will be retrieved considering HTTP headers "Forwarded" (optional and defined at RFC 7239 section 5.4) and "X-Forwarded-Proto" (a de facto standard); headers that could be sent by a proxy/balancer. If none of those headers is sent, then the function |
This is a very thoughtful addition, and it continues to work with my code. I have been testing with registrobr/rdap-client Thanks! |
Nice! Thanks for the help, now looking for the team's approval. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, anything to add @dhfelix ? Also looking for review of @TheRedTrainer .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verified. The scheme is included in self links, even if the request is managed by a proxy server.
.diff |
Rdap self links do not include the "scheme" - the protocol prefix like http:// or https:// - so they are neither valid relative nor absolute links (referred to as suffix references in rfc 3986). This PR adds the "scheme" and the "://" to each of the Servlets, as part of the variable called "header". The header goes nowhere other than the Link object, so this seems to work well and maintain consistency.
This change is RFC compliant, and brings reddog in line with verisign rdap, as well as all the usual REST services. The following is an example of a new links section:
See also:
links section example includes scheme: https://tools.ietf.org/html/rfc7483#section-4.2
suffix references are discouraged: https://tools.ietf.org/html/rfc3986#section-4.5
verisign rdap example: https://rdap-pilot.verisignlabs.com/rdap/v1/entity/299~VRSN