Hi all,
While playing around with akka-http, I wrote a minimal http proxy server:
https://gist.github.com/rklaehn/3aa3215046df2c0a7795
To test it, I configured a browser with this as proxy and browsed some
popular news web pages that load a zillion things from ad servers,
trackers and the like.
It works just fine, but I get a large number of warnings and the
occasional error in the log because apparently a lot of the
"secondary" traffic going over the proxy is not 100% correct according
to the HTTP spec. See some examples below.
Is it possible to tell akka-http to ignore errors such as
IllegalResponseException and just pass through everything? I don't see
a single line of my own code in the stack traces, so I am a bit at a
loss how to approach this.
Cheers,
Rüdiger
---
Opening connection to
weltonline01.webtrekk.net
[WARN] [01/31/2015 17:33:42.631]
[MinimalProxy-akka.actor.default-dispatcher-70]
[ActorSystem(MinimalProxy)] Illegal request header: Illegal 'cookie'
header: Invalid input ',', expected tchar, '\r', WSP or '=' (line 1,
column 32): C=1; cid=-6251207954767438390,0,0,0,0;
uid=-6251207954767438390
^
Opening connection to
track.adform.net
[WARN] [01/31/2015 17:33:42.679]
[MinimalProxy-akka.actor.default-dispatcher-56]
[ActorSystem(MinimalProxy)] Illegal response header: Illegal
'content-type' header: Invalid input ':', expected tchar, '\r', WSP or
'/' (line 1, column 13): Content-type: image/gif; charset=utf-8
^
[WARN] [01/31/2015 17:33:42.680]
[MinimalProxy-akka.actor.default-dispatcher-52]
[ActorSystem(MinimalProxy)] Explicitly set HTTP header 'content-type:
Content-type: image/gif; charset=utf-8' is ignored, illegal RawHeader
Opening connection to
comcluster.cxense.com
[ERROR] [01/31/2015 17:33:42.716]
[MinimalProxy-akka.actor.default-dispatcher-78]
[akka://MinimalProxy/user/$a/flow-15752-broadcast] failure during
processing
akka.http.model.IllegalResponseException: Illegal character ' ' in header name
at akka.http.engine.client.HttpClient$$anonfun$2.applyOrElse(HttpClient.scala:89)
at akka.http.engine.client.HttpClient$$anonfun$2.applyOrElse(HttpClient.scala:86)
at akka.stream.impl.fusing.Collect.onPush(Ops.scala:37)
...