Handle HTTP redirects sanely
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| | Bazaar |
Medium
|
Vincent Ladeuil | ||
Bug Description
It would be nice if bzr handled HTTP redirects sanely.
If getting http://
In the case of a temporary HTTP redirect, it should use the new URL for the duration of the bzr invocation.
In the case of a permanent HTTP redirect, bzr should record the new URL if it would normally have recorded the old URL. For example, "bzr pull" might update .bzr/parent, and "bzr branch http://..." would record the target URL rather than the specified one.
This is a prerequisite for the fix to bug 39015 to perform well.
Related branches
| James Blackwell (jblack) wrote : | #2 |
Some sites mod_rewrite requests to the top page for the site when in
dirindex mode.
On Wed, Mar 22, 2006 at 01:01:50PM -0000, James Henstridge wrote:
> Public bug reported:
> https:/
>
> Affects: bzr (upstream)
> Severity: Normal
> Priority: (none set)
> Status: Unconfirmed
>
> Description:
> It would be nice if bzr handled HTTP redirects sanely.
>
> If getting http://
> some other URL, it should send further requests to the target URL.
>
> In the case of a temporary HTTP redirect, it should use the new URL for
> the duration of the bzr invocation.
>
> In the case of a permanent HTTP redirect, bzr should record the new URL
> if it would normally have recorded the old URL. For example, "bzr pull"
> might update .bzr/parent, and "bzr branch http://..." would record the
> target URL rather than the specified one.
--
My home page: <a href="http://
Gnupg 06357400 F-print AAE4 8C76 58DA 5902 761D 247A 8A55 DA73 0635 7400
| Martin Pool (mbp) wrote : | #3 |
On 22 Mar 2006, Aaron Bentley <email address hidden> wrote:
> Public bug report changed:
> https:/
>
> Comment:
> James Henstridge wrote:
> > If getting http://
> > some other URL, it should send further requests to the target URL.
In fact we had a case recently where this would have been good, when we
changed from bazaar-ng.org to bazaar-vcs.org, and at the moment you get
redirects for all the urls.
> You know, I was thinking the same thing, but perversely enough, when I
> see your email, I come up with a counter-argument.
>
> A single redirect in a tree structure doesn't indicate that all the
> children would also redirect. It would be possible to redirect some or
> all of my branch files, while still maintaining the branch at a given
> location.
It might be reasonable to add an http redirect for one branch within a
repository. It seems a bit unlikely that within e.g. one store people
will want to redirect individual files, and it may be reasonable to
disallow it.
> On the other hand, bzr has a native form of redirction: Branch
> references. They're the kind of branch that a Checkout uses, but any
> attempt to open a Branch reference will instead open the referred-to branch.
--
Martin
| James Henstridge (jamesh) wrote : | #4 |
Here is another question related to this problem. Consider the following branches and repositories:
http://
http://
http://
http://
Now consider the following HTTP redirect:
http://
If I branch or checkout http://
One answer would be that files are looked up relative to the canonical location of some file (say .bzr/branch-
| Martin Pool (mbp) wrote : | #5 |
jamesh has a good point
| Changed in bzr: | |
| status: | Unconfirmed → Confirmed |
| James Henstridge (jamesh) wrote : | #6 |
I guess the above example can be simplified even further as a redirect of the form:
http://
This kind of change might be made if a user is switching to repositories, but the previous published locations make it difficult to use a shared repository. If the redirection is not taken into account when downloading the branch, no repository data will be seen at all.
| John A Meinel (jameinel) wrote : | #7 |
I gave an outline here of what we could do, and it seems to be well received.
http://
launchpad would like this to be integrated, so that they could use redirects when people request a branch from a main url.
I don't think it should block 0.9, though.
| description: | updated |
| John A Meinel (jameinel) wrote : | #8 |
I have a basic implementation plan, just need to implement it.
| Changed in bzr: | |
| assignee: | nobody → jameinel |
| John A Meinel (jameinel) wrote : | #9 |
bumping to 0.11
| John A Meinel (jameinel) wrote : | #10 |
This may be 0.12. 'vila' may also participate in solving this.
| Changed in bzr: | |
| assignee: | jameinel → v-ladeuil |
| John A Meinel (jameinel) wrote : | #11 |
Taking out of an explicit milestone until we get a clearer plan.
| Changed in bzr: | |
| status: | Confirmed → In Progress |
| Changed in bzr: | |
| status: | In Progress → Fix Committed |
| Vincent Ladeuil (vila) wrote : | #12 |
After several discussions, the implementation is to never silently follow redirections but raise an exception.
The only case, so far, where this exception is caught is when accessing a branch for the first time.
In that case the redirections are followed so that the following requests occur against the final target of th redirection chain.
| Changed in bzr: | |
| status: | Fix Committed → Fix Released |
| Scott Finman (scott-aocdesigns) wrote : | #13 |
Testing launchpad - nothing drastic, and will remove this. Apologies.
| Changed in bzr: | |
| assignee: | v-ladeuil → scott-aocdesigns |
| Scott Finman (scott-aocdesigns) wrote : | #14 |
This is a little bit too easy to alter other people's bugs! Reverting.
| Changed in bzr: | |
| assignee: | scott-aocdesigns → nobody |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Scott Finman wrote:
> This is a little bit too easy to alter other people's bugs! Reverting.
Please put things back the way you found them.
Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://
iD8DBQFG2tVR0F+
mkRcWG9URUsCOjX
=zdu2
-----END PGP SIGNATURE-----
| Vincent Ladeuil (vila) wrote : | #16 |
Revert assignee for historical purposes.
| Changed in bzr: | |
| assignee: | nobody → v-ladeuil |

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
James Henstridge wrote: hostname/ location/ .bzr results in a redirection to
> If getting http://
> some other URL, it should send further requests to the target URL.
You know, I was thinking the same thing, but perversely enough, when I
see your email, I come up with a counter-argument.
A single redirect in a tree structure doesn't indicate that all the
children would also redirect. It would be possible to redirect some or
all of my branch files, while still maintaining the branch at a given
location.
On the other hand, bzr has a native form of redirction: Branch
references. They're the kind of branch that a Checkout uses, but any
attempt to open a Branch reference will instead open the referred-to branch.
Aaron enigmail. mozdev. org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://
iD8DBQFEIVs00F+ nu1YWqI0RAhAYAJ 9VggcZ44YR0jYNw NCh/LOnHBl/ FACfR2gW AEhRsM/ s=
KaK35LkNZY4kIjB
=h08R
-----END PGP SIGNATURE-----