jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • HTTP Cache For Java
  • HTCJ-121

Digest authentication does not work if the url contains characters which has to be encoded in the path

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 3.4
  • Fix Version/s: None
  • Component/s: API
  • Labels:
    None
  • Patch Submitted:
    Yes
  • Source ID:
    https://github.com/hamnis/httpcache4j/pull/7

Description

If you access an url like /webservice/publication/demo/search/field-section:2+AND+meta-orderby:"creationDate+descending"/ with digest authentication, it will fail with:

java.lang.IllegalArgumentException
at java.net.URI.create(URI.java:842)
at org.codehaus.httpcache4j.auth.digest.RequestDigest.newInstance(RequestDigest.java:164)
at org.codehaus.httpcache4j.auth.DigestAuthenticatorStrategy.prepare(DigestAuthenticatorStrategy.java:56)
at org.codehaus.httpcache4j.auth.DigestAuthenticatorStrategy.prepare(DigestAuthenticatorStrategy.java:36)
at org.codehaus.httpcache4j.auth.DefaultAuthenticator.prepareAuthentication(DefaultAuthenticator.java:46)
at org.codehaus.httpcache4j.auth.DefaultAuthenticator.preparePreemptiveAuthentication(DefaultAuthenticator.java:67)
at org.codehaus.httpcache4j.resolver.AbstractResponseResolver.resolve(AbstractResponseResolver.java:65)
at org.codehaus.httpcache4j.cache.HTTPCache.resolveWithHeadRewrite(HTTPCache.java:240)
at org.codehaus.httpcache4j.cache.HTTPCache.handleResolve(HTTPCache.java:192)
at org.codehaus.httpcache4j.cache.HTTPCache.unconditionalResolve(HTTPCache.java:185)
at org.codehaus.httpcache4j.cache.HTTPCache.getFromStorage(HTTPCache.java:163)
at org.codehaus.httpcache4j.cache.HTTPCache.doRequest(HTTPCache.java:142)
at org.codehaus.httpcache4j.cache.HTTPCache.execute(HTTPCache.java:120)
at org.codehaus.httpcache4j.cache.HTTPCache.doCachedRequest(HTTPCache.java:101)
at com.escenic.client.webservice.WebClient.executeMethod(WebClient.java:169)
at com.escenic.client.webservice.WebClient.doGet(WebClient.java:270)
at com.escenic.client.webservice.AbstractClient.read(AbstractClient.java:196)
at com.escenic.client.webservice.AbstractClient.read(AbstractClient.java:179)
at com.escenic.client.webservice.AbstractClient.read(AbstractClient.java:175)
at com.escenic.client.search.OpenSearchPager.doSearch(OpenSearchPager.java:92)
at com.escenic.client.search.OpenSearchPager.initialize(OpenSearchPager.java:53)
at com.escenic.studio.core.tasks.SearchTask.doInBackground(SearchTask.java:70)
at com.escenic.studio.core.tasks.SearchTask.doInBackground(SearchTask.java:32)
at com.escenic.studio.core.StudioTask$RobustTask.doInBackground(StudioTask.java:393)
at javax.swing.SwingWorker$1.call(SwingWorker.java:277)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at javax.swing.SwingWorker.run(SwingWorker.java:316)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.net.URISyntaxException: Illegal character in path at index 69: /webservice/publication/demo/search/field-section:2+AND+meta-orderby:"creationDate+descending"/
at java.net.URI$Parser.fail(URI.java:2809)
at java.net.URI$Parser.checkChars(URI.java:2982)
at java.net.URI$Parser.parseHierarchical(URI.java:3066)
at java.net.URI$Parser.parse(URI.java:3024)
at java.net.URI.<init>(URI.java:578)
at java.net.URI.create(URI.java:840)
... 30 more

It is caused by going from URI object to String by using getPath() and back to URI. getPath decodes the string, which will then fail in URI.create. Using getRawPath instead will fix this.

Activity

  • All
  • Comments
  • Work Log
  • History
  • Activity
There are no comments yet on this issue.

People

  • Assignee:
    Erlend Hamnaberg
    Reporter:
    Rune Bremnes
Vote (0)
Watch (0)

Dates

  • Created:
    17/Jan/12 3:30 AM
    Updated:
    17/Jan/12 3:30 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.