java.net.URISyntaxException: Illegal character in query at index 33: http://www.ask.com/web?q=site:.nl .nl&frstpgo=0&page=1

GitHub | hmboonstra | 3 months ago
  1. 0

    VisitorAPI throws error on invalid referrer

    GitHub | 3 months ago | hmboonstra
    java.net.URISyntaxException: Illegal character in query at index 33: http://www.ask.com/web?q=site:.nl .nl&frstpgo=0&page=1
  2. 0

    GitHub comment 7#72202596

    GitHub | 2 years ago | akshay-bilani
    javax.ws.rs.core.UriBuilderException: java.net.URISyntaxException: Illegal character in query at index 97: https://v.whatsapp.net/v2/code?cc=91&in=8817919016&to=918817919016&lg=hi&lc=IN&method=sms&mcc=404|405|406&mnc=001&token=Q1eb8EfXBqjbbmyed0%2FZBRWHpkQ%3D&id=%7d%db%b60%9d%14%a7m%92%e3%1b%26%f3%fftt%df%a0p%8b
  3. 0

    All comments on Advanced Java Tutorial #3 - Text To Speech - YouTube

    youtube.com | 1 year ago
    java.net.URISyntaxException: Illegal character in query at index 69:
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    This change: https://jira.spring.io/browse/SPR-13876 introduced a defect where request's with an origin header and where the request url contains query parameter character's that are typically encoded, trigger a URI formatting exception. A plain Spring Web project with a no-op controller will reproduce this issue. You must pass the origin header though, as this triggers the DefaultCorsProcessor to fully execute. The call will work with a plain url and fail with a url with special characters: works: {{http://127.0.0.1:8080/demo/test?param=plain}} fails: {{http://127.0.0.1:8080/demo/test?param=^}} The root exception: {noformat} java.net.URISyntaxException: Illegal character in query at index 39: http://127.0.0.1:8080/demo/test?param={} at java.net.URI$Parser.fail(URI.java:2848) at java.net.URI$Parser.checkChars(URI.java:3021) at java.net.URI$Parser.parseHierarchical(URI.java:3111) at java.net.URI$Parser.parse(URI.java:3053) at java.net.URI.<init>(URI.java:588) at org.springframework.http.server.ServletServerHttpRequest.getURI(ServletServerHttpRequest.java:96) at org.springframework.web.util.UriComponentsBuilder.fromHttpRequest(UriComponentsBuilder.java:282) at org.springframework.web.util.WebUtils.isSameOrigin(WebUtils.java:814) at org.springframework.web.cors.DefaultCorsProcessor.processRequest(DefaultCorsProcessor.java:71) at org.springframework.web.servlet.handler.AbstractHandlerMapping$CorsInterceptor.preHandle(AbstractHandlerMapping.java:503) at org.springframework.web.servlet.HandlerExecutionChain.applyPreHandle(HandlerExecutionChain.java:134) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:954) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:968) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:859) at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:844) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) {noformat} I tested this with Jetty 9.3.2 and 9.3.8, and it reproduced in both versions. The exception is generated when the query parameter contains a curly brace or carat, but many other characters seem to work. I assume that is simply an aspect of the URI encoding spec that I'm less familiar with.

    Spring JIRA | 7 months ago | Russell Allen
    java.net.URISyntaxException: Illegal character in query at index 39: http://127.0.0.1:8080/demo/test?param={}
  6. 0

    This change: https://jira.spring.io/browse/SPR-13876 introduced a defect where request's with an origin header and where the request url contains query parameter character's that are typically encoded, trigger a URI formatting exception. A plain Spring Web project with a no-op controller will reproduce this issue. You must pass the origin header though, as this triggers the DefaultCorsProcessor to fully execute. The call will work with a plain url and fail with a url with special characters: works: {{http://127.0.0.1:8080/demo/test?param=plain}} fails: {{http://127.0.0.1:8080/demo/test?param=^}} The root exception: {noformat} java.net.URISyntaxException: Illegal character in query at index 39: http://127.0.0.1:8080/demo/test?param={} at java.net.URI$Parser.fail(URI.java:2848) at java.net.URI$Parser.checkChars(URI.java:3021) at java.net.URI$Parser.parseHierarchical(URI.java:3111) at java.net.URI$Parser.parse(URI.java:3053) at java.net.URI.<init>(URI.java:588) at org.springframework.http.server.ServletServerHttpRequest.getURI(ServletServerHttpRequest.java:96) at org.springframework.web.util.UriComponentsBuilder.fromHttpRequest(UriComponentsBuilder.java:282) at org.springframework.web.util.WebUtils.isSameOrigin(WebUtils.java:814) at org.springframework.web.cors.DefaultCorsProcessor.processRequest(DefaultCorsProcessor.java:71) at org.springframework.web.servlet.handler.AbstractHandlerMapping$CorsInterceptor.preHandle(AbstractHandlerMapping.java:503) at org.springframework.web.servlet.HandlerExecutionChain.applyPreHandle(HandlerExecutionChain.java:134) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:954) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:968) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:859) at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:844) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) {noformat} I tested this with Jetty 9.3.2 and 9.3.8, and it reproduced in both versions. The exception is generated when the query parameter contains a curly brace or carat, but many other characters seem to work. I assume that is simply an aspect of the URI encoding spec that I'm less familiar with.

    Spring JIRA | 7 months ago | Russell Allen
    java.net.URISyntaxException: Illegal character in query at index 39: http://127.0.0.1:8080/demo/test?param={}

  1. tfr 1 times, last 6 months ago
  2. muffinmannen 1 times, last 8 months ago
36 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.net.URISyntaxException

    Illegal character in query at index 33: http://www.ask.com/web?q=site:.nl .nl&frstpgo=0&page=1

    at java.net.URI$Parser.fail()
  2. Java RT
    URI.<init>
    1. java.net.URI$Parser.fail(URI.java:2848)[?:1.8.0_77]
    2. java.net.URI$Parser.checkChars(URI.java:3021)[?:1.8.0_77]
    3. java.net.URI$Parser.parseHierarchical(URI.java:3111)[?:1.8.0_77]
    4. java.net.URI$Parser.parse(URI.java:3053)[?:1.8.0_77]
    5. java.net.URI.<init>(URI.java:588)[?:1.8.0_77]
    5 frames
  3. com.dotcms.visitor
    VisitorAPIImpl.getVisitor
    1. com.dotcms.visitor.business.VisitorAPIImpl.lookupReferrer(VisitorAPIImpl.java:172)[dotcms_3.5.1_3.5-8-g8506266.jar:?]
    2. com.dotcms.visitor.business.VisitorAPIImpl.createVisitor(VisitorAPIImpl.java:117)[dotcms_3.5.1_3.5-8-g8506266.jar:?]
    3. com.dotcms.visitor.business.VisitorAPIImpl.getVisitor(VisitorAPIImpl.java:70)[dotcms_3.5.1_3.5-8-g8506266.jar:?]
    4. com.dotcms.visitor.business.VisitorAPIImpl.getVisitor(VisitorAPIImpl.java:45)[dotcms_3.5.1_3.5-8-g8506266.jar:?]
    4 frames