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

No special characters supported #35

Closed
pardocorp opened this issue May 4, 2017 · 21 comments
Closed

No special characters supported #35

pardocorp opened this issue May 4, 2017 · 21 comments

Comments

@pardocorp
Copy link

pardocorp commented May 4, 2017

I just try with an image than has special character á and I got this error

Original URL: xxxx.xxx/wp-content/uploads/2017/05/mot-Bogotá.png

Please, submit this stacktrace to GitHub and we'll try to help: https://github.com/yegor256/jare/issues

java.lang.IllegalStateException: [GET http://relay.jare.io/?u=https%3A%2F%2Fwww.guimot.com%2Fwp-content%2Fuploads%2F2017%2F05%2FGuimot-Bogota%CC%81.png] failed in 0ms: [400] target URL "https://www.guimot.com/wp-content/uploads/2017/05/Guimot-Bogota�.png" is not compliant with RFC3986
	at org.takes.facets.fallback.TkFallback.error(TkFallback.java:233)
	at org.takes.facets.fallback.TkFallback.route(TkFallback.java:89)
	at org.takes.facets.fallback.TkFallback.access$000(TkFallback.java:54)
	at org.takes.facets.fallback.TkFallback$1.act(TkFallback.java:66)
	at org.takes.tk.TkWrap.act(TkWrap.java:61)
	at org.takes.facets.fork.FkHost$1.route(FkHost.java:81)
	at org.takes.facets.fork.FkWrap.route(FkWrap.java:61)
	at org.takes.facets.fork.FkChain.route(FkChain.java:75)
	at org.takes.facets.fork.TkFork.act(TkFork.java:100)
	at org.takes.facets.forward.TkForward.act(TkForward.java:69)
	at org.takes.facets.fork.FkFixed$1.route(FkFixed.java:56)
	at org.takes.facets.fork.FkWrap.route(FkWrap.java:61)
	at org.takes.facets.fork.FkChain.route(FkChain.java:75)
	at org.takes.facets.fork.TkFork.act(TkFork.java:100)
	at org.takes.facets.auth.TkAuth.act(TkAuth.java:91)
@0crat
Copy link

0crat commented May 4, 2017

@yegor256 please, pay attention to this issue

@yegor256
Copy link
Owner

yegor256 commented May 5, 2017

@pardocorp well, the error message says itself: "target URL "https://www.guimot.com/wp-content/uploads/2017/05/Guimot-Bogota�.png" is not compliant with RFC3986"

You have to encode it twice, using, for example, this encoder.

This is the name of the file: mot-Bogotá.png

This is the URL of the image: https://www.guimot.com/wp-content/uploads/2017/05/mot-Bogot%C3%A1.png

The is its encoded form for the URL: https%3A%2F%2Fwww.guimot.com%2Fwp-content%2Fuploads%2F2017%2F05%2Fmot-Bogot%25C3%25A1.png

This is the final URL: http://relay.jare.io/?u=https%3A%2F%2Fwww.guimot.com%2Fwp-content%2Fuploads%2F2017%2F05%2Fmot-Bogot%25C3%25A1.png

@yegor256
Copy link
Owner

yegor256 commented May 5, 2017

@pardocorp and it still throws an exception:

target URL "https://www.guimot.com/wp-content/uploads/2017/05/mot-Bogot%C3%A1.png" is not compliant with RFC3986
	at io.jare.tk.TkRelay.act(TkRelay.java:89)
	at org.takes.facets.fallback.TkFallback.route(TkFallback.java:85)
	... 38 more

This is definitely not true. Let me investigate.

yegor256 added a commit that referenced this issue May 5, 2017
yegor256 added a commit that referenced this issue May 8, 2017
@yegor256
Copy link
Owner

yegor256 commented May 8, 2017

@rultor release, tag is 0.9.2

@rultor
Copy link
Collaborator

rultor commented May 8, 2017

@rultor release, tag is 0.9.2

@yegor256 OK, I will release it now. Please check the progress here

@rultor
Copy link
Collaborator

rultor commented May 8, 2017

@rultor release, tag is 0.9.2

@pardocorp @yegor256 Oops, I failed. You can see the full log here (spent 2min)

  TkRelayTest.sendsRequestThroughToHome:70->lambda$sendsRequestThroughToHome$1:71 
Expected: "http://localhost:59079/alpha/%D0%B4%D0%B0?a=%D0%B0"
     but: was "http://localhost:59079/alpha/%D0%B4%D0%B0?a=%3F%3F"

Tests run: 21, Failures: 1, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 27.219 s
[INFO] Finished at: 2017-05-08T13:02:58+00:00
[INFO] Final Memory: 60M/559M
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "jare" could not be activated because it does not exist.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project web: There are test failures.
[ERROR] 
[ERROR] Please refer to /home/r/repo/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project web: There are test failures.

Please refer to /home/r/repo/target/surefire-reports for the individual test results.
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoFailureException: There are test failures.

Please refer to /home/r/repo/target/surefire-reports for the individual test results.
	at org.apache.maven.plugin.surefire.SurefireHelper.reportExecution(SurefireHelper.java:91)
	at org.apache.maven.plugin.surefire.SurefirePlugin.handleSummary(SurefirePlugin.java:320)
	at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:892)
	at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:755)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
	... 20 more
[ERROR] 
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
container 28f7f19f6b8a5618ae1361852b50fc5e82f973c7813b1f01ab171eee5de4be6b is dead
Mon May  8 13:03:55 UTC 2017

yegor256 added a commit that referenced this issue May 8, 2017
@yegor256
Copy link
Owner

yegor256 commented May 8, 2017

@rultor release, tag is 0.9.2

@rultor
Copy link
Collaborator

rultor commented May 8, 2017

@rultor release, tag is 0.9.2

@yegor256 OK, I will release it now. Please check the progress here

@rultor
Copy link
Collaborator

rultor commented May 8, 2017

@rultor release, tag is 0.9.2

@pardocorp @yegor256 Oops, I failed. You can see the full log here (spent 2min)

  TkRelayTest.sendsRequestThroughToHome:70->lambda$sendsRequestThroughToHome$1:71 
Expected: "http://localhost:43819/alpha/%D0%B4%D0%B0?%D0%B0=%D0%B0"
     but: was "http://localhost:43819/alpha/%D0%B4%D0%B0?%3F%3F=%3F%3F"

Tests run: 21, Failures: 1, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 28.041 s
[INFO] Finished at: 2017-05-08T13:37:22+00:00
[INFO] Final Memory: 59M/583M
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "jare" could not be activated because it does not exist.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project web: There are test failures.
[ERROR] 
[ERROR] Please refer to /home/r/repo/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project web: There are test failures.

Please refer to /home/r/repo/target/surefire-reports for the individual test results.
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoFailureException: There are test failures.

Please refer to /home/r/repo/target/surefire-reports for the individual test results.
	at org.apache.maven.plugin.surefire.SurefireHelper.reportExecution(SurefireHelper.java:91)
	at org.apache.maven.plugin.surefire.SurefirePlugin.handleSummary(SurefirePlugin.java:320)
	at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:892)
	at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:755)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
	... 20 more
[ERROR] 
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
container 578d37eaa8e33a3f99619b980a4a8427bb4c92faa65afb6b3a4f8390495e7653 is dead
Mon May  8 13:38:23 UTC 2017

yegor256 added a commit that referenced this issue May 8, 2017
@yegor256
Copy link
Owner

yegor256 commented May 8, 2017

@rultor release, tag is 0.9.2

@rultor
Copy link
Collaborator

rultor commented May 8, 2017

@rultor release, tag is 0.9.2

@yegor256 OK, I will release it now. Please check the progress here

@rultor
Copy link
Collaborator

rultor commented May 8, 2017

@rultor release, tag is 0.9.2

@yegor256 Done! FYI, the full log is here (took me 3min)

@yegor256
Copy link
Owner

yegor256 commented May 8, 2017

@pardocorp please, check. I believe, the problem is fixed.

@pardocorp
Copy link
Author

pardocorp commented May 8, 2017

Hi @yegor256 same error:

Originan image:
https://www.guimot.com/wp-content/uploads/2017/05/Escudo-de-Bogota%CC%81.png

jare.io image:
https://cf.jare.io/?u=https://www.guimot.com/wp-content/uploads/2017/05/Escudo-de-Bogota%CC%81.png

Some users in Latinamerica use this kind of special characters on their content (á, é, í, ó, ú, ñ)

@punitcodes
Copy link

@yegor256
Copy link
Owner

@pardocorp yes, indeed, as @punit2502 suggested, you have to encode your URL twice.

@pardocorp
Copy link
Author

Thanks @yegor256 and @punit2502 I can encode the URL twice but, this images were uploaded using the wordpress media loader and as you see they doesn't applied a double encoding.

@yegor256
Copy link
Owner

@pardocorp I'm not sure I understand the problem. You're building that URLs, right? Just create them correctly. At the moment they are just not valid, that's why jare.io complains.

@punitcodes
Copy link

@pardocorp Once your image is uploaded to your media library in WordPress, copy its url and encode it.
When adding your image to any post or page in WordPress, open Text view and replace your image urls with encoded jare.io CDN url.

@pardocorp
Copy link
Author

@yegor256 I'm not building the URLs, those URLs are built by the WordPress media uploader, as @punit2502 said I can fix it using an text view and edit it with encoded jare.io CDN url.

@0crat
Copy link

0crat commented May 17, 2017

Oops! Job gh:yegor256/jare#35 was not in scope

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

5 participants