-
Notifications
You must be signed in to change notification settings - Fork 493
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
Fixes #2724: Broken handling of AWS S3 urls #2725
Conversation
After testing some more, there is another "double url-encoding" issue that I believe is caused by a call to |
I think the same, this issue is fixed in 4.3 but not yet in 4.4. |
a463331
to
f14e924
Compare
…h urls containing %
@vga91 thanks! I tested locally and confirmed the double-encoding issue is fixed after cherry-picking that commit. @leonpierre that's correct. After fixing a couple of S3-specific issues, I then hit the double-encoding issue as well, and started to investigate. As @vga91 mentioned, there is already a fix for that issue in 4.3 that needs to be pulled into 4.4. I pulled that change into this PR and confirmed the double-encoding issue is fixed for me now. |
|
|
||
Integer slashIndex = url.getPath().lastIndexOf("/"); | ||
Integer slashIndex = uri.getPath().indexOf("/", 1); |
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.
👍
String endpoint = url.getHost(); | ||
String endpoint = uri.getHost(); | ||
|
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.
There's a problem with this (and that's why the LoadS3Test
tests are failing). The example I give is with http addresses, but it would be similar for S3 ones:
import java.net.{URL, URI}
new URL("http://us-east-1.127.0.0.1:55220/test-bucket/test.csv?accessKey=accesskey&secretKey=secretkey").getHost
// us-east-1.127.0.0.1
new URI("http://us-east-1.127.0.0.1:55220/test-bucket/test.csv?accessKey=accesskey&secretKey=secretkey").getHost
// null
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 experimented with a fix for that in 80e800d. Feel free to discard it if you have a better suggestion
f7ac189
to
8ce346c
Compare
8952c25
to
80e800d
Compare
…ib#2725) * Fixes neo4j-contrib#2724, AWS S3 url handling * Fixes neo4j-contrib#2269: apoc.load procedures don't work anymore with urls containing % * Code formatting * Adds fix for the getHost problem Co-authored-by: Giuseppe Villani <[email protected]> Co-authored-by: Nacho Cordón <[email protected]>
…ib#2725) * Fixes neo4j-contrib#2724, AWS S3 url handling * Fixes neo4j-contrib#2269: apoc.load procedures don't work anymore with urls containing % * Code formatting * Adds fix for the getHost problem Co-authored-by: Giuseppe Villani <[email protected]> Co-authored-by: Nacho Cordón <[email protected]>
* Fixes #2724, AWS S3 url handling * Fixes #2269: apoc.load procedures don't work anymore with urls containing % * Code formatting * Adds fix for the getHost problem Co-authored-by: Giuseppe Villani <[email protected]> Co-authored-by: Nacho Cordón <[email protected]>
…ib#2725) * Fixes neo4j-contrib#2724, AWS S3 url handling * Fixes neo4j-contrib#2269: apoc.load procedures don't work anymore with urls containing % * Code formatting * Adds fix for the getHost problem Co-authored-by: Giuseppe Villani <[email protected]> Co-authored-by: Nacho Cordón <[email protected]>
…ib#2725) * Fixes neo4j-contrib#2724, AWS S3 url handling * Fixes neo4j-contrib#2269: apoc.load procedures don't work anymore with urls containing % * Code formatting * Adds fix for the getHost problem Co-authored-by: Giuseppe Villani <[email protected]> Co-authored-by: Nacho Cordón <[email protected]>
…ib#2725) * Fixes neo4j-contrib#2724, AWS S3 url handling * Fixes neo4j-contrib#2269: apoc.load procedures don't work anymore with urls containing % * Code formatting * Adds fix for the getHost problem Co-authored-by: Giuseppe Villani <[email protected]> Co-authored-by: Nacho Cordón <[email protected]>
* Fixes #2724, AWS S3 url handling * Fixes #2269: apoc.load procedures don't work anymore with urls containing % * Code formatting * Adds fix for the getHost problem Co-authored-by: Giuseppe Villani <[email protected]> Co-authored-by: Nacho Cordón <[email protected]>
* Fixes #2724, AWS S3 url handling * Fixes #2269: apoc.load procedures don't work anymore with urls containing % * Code formatting * Adds fix for the getHost problem Co-authored-by: Giuseppe Villani <[email protected]> Co-authored-by: Nacho Cordón <[email protected]>
Fixes #2724
java.net.URI
instead ofjava.net.URL
, which returns the values decoded)Proposed Changes (Mandatory)
S3ParamExtractor
to construct ajava.net.URI
from the S3 url so when we callgetUserInfo
, we get a decoded value (java.net.URL#getUserInfo
returns the original encoded value)./
(after the leading/
) rather than last