Skip to content

Conversation

@bennettpeter
Copy link
Contributor

IPV6 URLs are of the form http://[2607:f8b0:4006:823::200e]/ but the code was removing the square brackets from the URL, resulting in an invalid URL and a MalformedURLException.

Description

Cater for IPV6 URLS of the form http://[2607:f8b0:4006:823::200e]/

Motivation and Context

Glide throws exceptions and fails if using IPV6 IP Addresses

@bennettpeter bennettpeter marked this pull request as ready for review September 5, 2024 17:50
@kanelbulle
Copy link
Collaborator

Could you please add a test for this?

@bennettpeter
Copy link
Contributor Author

I assume that you are referring to "Test cases for issues" described in https://bumptech.github.io/glide/tut/failing-test-cases.html . I will work on that.

@bennettpeter
Copy link
Contributor Author

I am having a problem creating a test case as documented in https://bumptech.github.io/glide/tut/failing-test-cases.html . I followed the directions and created instrumentation/src/androidTest/java/com/bumptech/glide/Issue5444Test.java . Trying to run it by using "Run Issue5444test" results in the following errors:

The option setting 'android.experimental.testOptions.emulatorSnapshots.maxSnapshotsForTestFailures=0' is experimental.
Please correct the above warnings first.

The same happens if I try to run any of the tests that already exist in the directory instrumentation/src/androidTest/java/com/bumptech/glide

I tried updating annotation/compiler/proguard.pro by adding -ignorewarnings at the end. This causes the following errors when running my test or existing tests in the directory::

No SupportedSourceVersion annotation found on com.bumptech.glide.annotation.compiler.GlideAnnotationProcessor, returning RELEASE_6.
Supported source version 'RELEASE_6' from annotation processor 'org.gradle.api.internal.tasks.compile.processing.TimeTrackingProcessor' less than -source '11'
No SupportedAnnotationTypes annotation found on com.bumptech.glide.annotation.compiler.GlideAnnotationProcessor, returning an empty set.
warnings found and -Werror specified

@kanelbulle
Copy link
Collaborator

I assume that you are referring to "Test cases for issues" described in https://bumptech.github.io/glide/tut/failing-test-cases.html . I will work on that.

There is an existing test file for this class already, GlideUrlTest.java, can you add to that?

@bennettpeter
Copy link
Contributor Author

I have added a test case to branch issue5444test. The test case fails because of the reported bug and succeeds if you merge this pull request IPV6-fix. The test uses URL http://[2600:1f13:37c:1400:ba21:7165:5fc7:736e]/ which is a valid internet URL.

@kanelbulle
Copy link
Collaborator

Thank you! Could you please combine the changes into this PR so they can get tested & merged at the same time?

IPV6 URLs are of the form http://[2607:f8b0:4006:823::200e]/ but the
code was removing the square brackets from the URL, resulting in an
invalid URL and a MalformedURLException.
@bennettpeter
Copy link
Contributor Author

As requested, I have rebased and merged issue issue5444test into pull request IPV6-fix. The test runs successfully.

@kanelbulle
Copy link
Collaborator

thank you!

@how8570
Copy link

how8570 commented Aug 15, 2025

Hey, any update here?
Can this change be submitted with the next release?

@falhassen falhassen merged commit 8eaae21 into bumptech:master Aug 18, 2025
3 checks passed
@how8570
Copy link

how8570 commented Sep 1, 2025

Hey there, why 900f060c9ec3ce29e43d9fd9ac7b2dbda6e3d6e3 drop this changes?

@bennettpeter
Copy link
Contributor Author

The pull request was reversed by a subsequent commit, as noted above by @how8570 . Please fox this.

@johnnyshieh8
Copy link

Hi @falhassen

This pull request was reversed by a subsequent commit 900f060, please fix this.
Thanks.

@falhassen
Copy link
Collaborator

I'm sorry about this. It looks like a configuration issue with a bot.

I'll start try to revert this and create a new Glide release that includes the fix.

copybara-service bot pushed a commit that referenced this pull request Sep 10, 2025
…with IPV6 addresses #5444

PiperOrigin-RevId: 805389202
copybara-service bot pushed a commit that referenced this pull request Sep 10, 2025
…with IPV6 addresses #5444

PiperOrigin-RevId: 805389202
copybara-service bot pushed a commit that referenced this pull request Sep 10, 2025
…with IPV6 addresses #5444

PiperOrigin-RevId: 805434429
@falhassen
Copy link
Collaborator

5.0.5 is out with the fix

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

Successfully merging this pull request may close these issues.

5 participants