takes: Invalid HTTP method: X-Takes-LocalAddress

I got this error sometimes with the current version of Takes :

java.io.IOException: Invalid HTTP method: X-Takes-LocalAddress:
	at org.takes.rq.RqMethod$Base.method(RqMethod.java:124)
	at org.takes.facets.fallback.TkFallback.error(TkFallback.java:234)
	at org.takes.facets.fallback.TkFallback.fallback(TkFallback.java:138)
	at org.takes.facets.fallback.TkFallback.route(TkFallback.java:88)
	at org.takes.facets.fallback.TkFallback.lambda$new$0(TkFallback.java:66)
	at org.takes.tk.TkWrap.act(TkWrap.java:58)
	at org.takes.tk.TkWrap.act(TkWrap.java:58)
	at org.takes.tk.TkSlf4j.act(TkSlf4j.java:110)
	at org.takes.http.FtCli.lambda$start$0(FtCli.java:91)
	at org.takes.http.BkBasic.print(BkBasic.java:123)
	at org.takes.http.BkBasic.accept(BkBasic.java:99)
	at org.takes.http.BkSafe.lambda$new$0(BkSafe.java:46)
	at org.takes.http.BkWrap.accept(BkWrap.java:51)
	at org.takes.http.BkTimeable.accept(BkTimeable.java:92)
	at org.takes.http.BkParallel.lambda$new$0(BkParallel.java:81)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:750)

While debugging, we got this: image

It looks like RqRequestLine.Base doesn’t do the right job 😦

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 17 (17 by maintainers)

Commits related to this issue

Most upvoted comments

@EugenDueck It occurs on Windows with JDK 8

Here’s a really short version that still replicates the problem (again on Windows, using takes 1.24.4; this time around, it took 35k attempts, in 237 seconds):

    public static void main(String[] args) throws IOException {
        new FtBasic(new TkFork(new FkRegex("/a", "k")), 8100).start(Exit.NEVER);
    }

The exception:

org.takes.HttpException: 404
        at org.takes.facets.fork.TkFork.act(TkFork.java:102)
        at org.takes.http.BkBasic.print(BkBasic.java:123)
        at org.takes.http.BkBasic.accept(BkBasic.java:99)
        at org.takes.http.BkSafe.lambda$new$0(BkSafe.java:46)
        at org.takes.http.BkWrap.accept(BkWrap.java:51)
        at org.takes.http.FtBasic.loop(FtBasic.java:113)
        at org.takes.http.FtBasic.start(FtBasic.java:99)

I just replicated the issue with the latest stable takes 1.24.4, on the same Windows machine: Once after 36k requests, another time after 14k requests, and once it took 193k requests!