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

SharedHttpCacheStorage doesnt resolve redirect correctly if the uri that is given isn't normalized #2666

Closed
jcompagner opened this issue Jul 27, 2023 · 2 comments

Comments

@jcompagner
Copy link
Contributor

The getCacheEntry function:
https://github.com/eclipse-tycho/tycho/blob/master/p2-maven-plugin/src/main/java/org/eclipse/tycho/p2maven/transport/SharedHttpCacheStorage.java#L92

should normalize the incoming url, so that will not become an extra redirect that the HttpClient of java does (and then 2 redirects must be followed what the code of Tycho doesn't do and then you get a stack overflow because getCachedEntry is constantly called by itself through the redirect code.

	public CacheEntry getCacheEntry(URI uriParam, Logger logger) throws FileNotFoundException {
		URI uri = uriParam.normalize();

that is the code that fixes it, the param is renamed and the an variable uri is made that is the normalized version of it.
Then the Java HttpClient doesn't treat this as a extra redirect.

jcompagner added a commit to jcompagner/tycho that referenced this issue Jul 28, 2023
that is given isn't normalized eclipse-tycho#2666

make sure taht the incoming uri param is normalized when used further
up. This way it is not an extra redirect (so there are 2 redirects to
the final source)
jcompagner added a commit to jcompagner/tycho that referenced this issue Jul 28, 2023
that is given isn't normalized eclipse-tycho#2666

make sure taht the incoming uri param is normalized when used further
up. This way it is not an extra redirect (so there are 2 redirects to
the final source)
jcompagner added a commit to jcompagner/tycho that referenced this issue Jul 28, 2023
that is given isn't normalized eclipse-tycho#2666

make sure taht the incoming uri param is normalized when used further
up. This way it is not an extra redirect (so there are 2 redirects to
the final source)
jcompagner added a commit to jcompagner/tycho that referenced this issue Jul 28, 2023
that is given isn't normalized eclipse-tycho#2666

make sure taht the incoming uri param is normalized when used further
up. This way it is not an extra redirect (so there are 2 redirects to
the final source)
laeubi pushed a commit that referenced this issue Jul 28, 2023
…that is given isn't normalized #2666

make sure that the incoming uri param is normalized when used further
up. This way it is not an extra redirect (so there are 2 redirects to
the final source)
github-actions bot pushed a commit that referenced this issue Jul 28, 2023
…that is given isn't normalized #2666

make sure that the incoming uri param is normalized when used further
up. This way it is not an extra redirect (so there are 2 redirects to
the final source)

(cherry picked from commit f426ca2)
laeubi pushed a commit that referenced this issue Jul 29, 2023
…that is given isn't normalized #2666 (#2675)

make sure that the incoming uri param is normalized when used further
up. This way it is not an extra redirect (so there are 2 redirects to
the final source)

(cherry picked from commit f426ca2)

Co-authored-by: Johan Compagner <jcompagner@gmail.com>
@laeubi
Copy link
Member

laeubi commented Sep 4, 2023

@jcompagner can this be closed now or do you still see issues?

@jcompagner
Copy link
Contributor Author

yes this one is fixed 4.0.1 works fine now for our product build

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

No branches or pull requests

2 participants