-
Notifications
You must be signed in to change notification settings - Fork 125
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
Added status code 308 #582
Conversation
-1, as this RFC is a draft only and it won't be possible due to WORA to remove support of 308 in case it never reaches public standard status. |
@mithunsasidharan Can you please rebase on master? I had to clean it up so we have a clean starting point for contributions. Thanks, and sorry for the trouble. |
@mkarg : for some reason the commit sign off is failing although I've it in my commit. kindly review once. thanks! |
@mithunsasidharan Can you please squash then rebase on master? Maybe this fixes the missing sign-off? |
@mithunsasidharan Please rebase against HEAD of branch |
* @throws java.lang.IllegalArgumentException | ||
* if location is {@code null}. | ||
*/ | ||
public static ResponseBuilder permanentRedirect(URI location) { |
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.
I'm not convinced that a shortcut method permanentRedirect
is required. A lot of other, IMO more important, status codes don't have shortcut methods either. I would rather not bloat this class with another method -- if we decide to add the enum.
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.
I share this opinion.
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.
Well, these shortcut methods are especially important for status codes that need additional headers to be set. Playing devil's advocate here, actually 308 would be a good example for a status method for which a shortcut method would make sense.
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.
@mkarg @sdaschner : I suggest for now, lets keep it as is ...ie to have the shortcut method.
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.
We should only consider adding this method if a majority agrees on its usefulness. And currently most comments questioned it. So let's wait for other comments.
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.
@spericas Does that mean "plus one" or "zero" from your side? Just for correctly counting votes.
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.
@sdaschner "Minus one" due to the shortcut method, or "zero" because it was only a comment? Just for counting votes correctly.
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.
Zero then. When I think about it more, I do see the advantage that you want to add an URI, similar to created
, what @chkal mentioned.
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.
@mkarg It is a +1 for me. This error code is widely supported in all major browsers, that is good enough for me. As I said, I also don't have a problem keeping the static method.
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.
Sum so far (as not everybody used the Github review tool): chkal 0, mkarg -1, spericas +1, sdaschner 0 => result 0.
@@ -1296,6 +1311,10 @@ public default Status toEnum() { | |||
* 307 Temporary Redirect, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.8">HTTP/1.1 documentation</a>}. | |||
*/ | |||
TEMPORARY_REDIRECT(307, "Temporary Redirect"), | |||
/** | |||
* 308 Temporary Redirect, see {@link <a href="https://tools.ietf.org/html/rfc7538">HTTP/1.1 documentation</a>}. |
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.
The link text should say something like The Hypertext Transfer Protocol Status Code 308 (Permanent Redirect)
, see RFC 7538, not HTTP/1.1 documentation
.
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.
Actually this is not @mithunsasidharan's fault: That style was chosen by Oracle years before, as you can see in the already existing status codes. But I share your opinion, we should not continue that bad style.
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.
I was only referring to the link text. I suggest that it reads 308 Temporary Redirect, see {@link <a href="https://tools.ietf.org/html/rfc7538">The Hypertext Transfer Protocol Status Code 308 (Permanent Redirect)</a>}.
or similar
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.
@mkarg @sdaschner : Its the same style we chose so going by that.. I can refactor all in another PR once we decide on it.
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.
It's not about the style, I'm just commenting on the link text; that particular RFC 7538 is called "The Hypertext Transfer Protocol Status Code 308 (Permanent Redirect)".
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.
@sdaschner : Can you check now.. I've fixed that !
Signed-off-by: Mithun Sasidharan <[email protected]>
@mkarg : rebased and signed off. Please review the PR now. |
Can jaxrs start to keep a registry of all RFCs that are intended to be satisfied? This RFC is a "proposed standard," several such RFCs at the same status are already implemented by jaxrs and other JSRs. Since work is commencing here, I guess that's been admitted already. Still, a registry of RFCs seems lacking, at least from my quick skim of the most recent spec. |
@derekm Please file a separate request/Issue for the registry |
@spericas What is your opinion about adding 308 although the RFC is "proposed standard"? |
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.
@mithunsasidharan Your PR still asks for merge into master
but you have to request merge into 3-SNAPSHOT
. According to the PMC we must not accept PRs against master
, and as 308 is not yet part of the IETF STD track but only a proposed standard it cannot be accepted in an earlier branch. Please change this now so we can finally vote and (hopefully) merge.
I think we would do a failure adding this 308 at this location. Please have a look at the description of this class:
It clearly says that this class is for HTTP/1.1 only, but extensions have to go into different implementations of the Hence -1 for extending the wrong class. A clean solution for now would be adopting a new class like |
@mkarg : I will update the PR to point to |
I really dislike having something like |
So far we did not reach a concensus on this PR. It would be good if more committers would actively use the Github review tool on this particular issue to cast a vote, so a clear majority can be found. Until then, I simply let this PR open. |
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.
My requested changes are done (3-SNAPSHOT as target of the PR), but as I am not conviced about the correctness of adding pre-standard 308 to particularly the Response
class, I hereby abstain from voting.
@mkarg : Do we have a consensus on what to be done with this yet ? |
@mithunsasidharan Not finally. At the moment there is no majority for adopting the change due to the already discussed concerns. One idea was that I could open a separate project for "near-to-standard" things, or a "external contributions" project. One could then simply add this to his application to adopt such RFCs. I do not say that this is a final decision, as the committers have not finally voted, but at least this is the current status of this PR. Please stay tuned, we still are thinking... :-) |
@spericas Why did you close this PR? The discussion was still running, and the PR was assigned to me, not to you. |
@mkarg I didn't, at least not intentionally :) But I did remove 3-SNAPSHOT. A side effect of that perhaps? |
@spericas Understood, but how can I reopen it? |
@spericas Just noticed: One has to [edit] then change the target branch, then click [Reopen] in the comments box. |
@spericas Can you please create a milestone named |
On Mar 17, 2018, at 8:46 AM, Markus KARG ***@***.***> wrote:
@spericas <https://github.com/spericas> Can you please create a milestone named 3 so I can keep track of PRs like this one? It seems committers can created branches, tags and labels, but not milestones in Github. Thanks.
Done.
— Santiago
|
@spericas Thanks! :-) |
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.
-
I left a comment about the 'Proposed Standard" issue on Add status code 308 #573. I don't think it's a concern.
-
I agree that adding the permanentRedirect() method is useful.
FWIW, RFC 7538 has exactly the same standards track status as the base HTTP specs (RFC 723?): "proposed". There really is no problem with that. Also, status codes are an extension point of HTTP. There's really no point in hard-wiring anything into an API, in particular not as Enums. |
/** | ||
* 308 Permanent Redirect, see {@link <a href="https://tools.ietf.org/html/rfc7538">HTTP/1.1 documentation</a>}. | ||
*/ | ||
PERMANENT_REDIRECT(308, "Permanent Redirect"), |
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.
Not related to this PR, but still: what's the point in citing RFC 2616? It has been obsoleted years ago.
The selected milestone for this pull request is 4.0. I wonder if we can get this into the 3.1-SNAPSHOT branch. Thoughts? |
Fine for me. Go ahead with that. :-) |
@mithunsasidharan Are you still interested in working on this? If so, could you rebase against `3.1-SNAPSHOT" and update the pull request accordingly? |
Last comment is over 1 year old. Closing this one. |
Added status code 308
Fixes issue #573
RFC 7538 describes the behavior of the HTTP status code 308. While this RFC is quite new it solves an actual problem regarding POST redirections.
And it completes quite well the 307 status code found in the HTTP 1.1 RFC (previously described in the obsolete RFC 2616).