Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

I see "MalformedURLException: unknown protocol" in logs #385

Open
asolntsev opened this issue Nov 20, 2021 · 2 comments
Open

I see "MalformedURLException: unknown protocol" in logs #385

asolntsev opened this issue Nov 20, 2021 · 2 comments

Comments

@asolntsev
Copy link
Contributor

Describe the bug
Sometimes I see "MalformedURLException: unknown protocol" error in logs, though everything works well.

I think BUP should just ignore such URLs like content-signature-2.cdn.mozilla.net. It seems these are some internal resources used by browser itself.

[LittleProxy-7-ClientToProxyWorker-1] ERROR com.browserup.bup.BrowserUpProxyServer - The requested URL is not valid.
    java.net.MalformedURLException: unknown protocol: content-signature-2.cdn.mozilla.net
    	at java.base/java.net.URL.<init>(URL.java:652)
    	at java.base/java.net.URL.<init>(URL.java:541)
    	at java.base/java.net.URL.<init>(URL.java:488)
    	at com.browserup.bup.BrowserUpProxyServer$2.lookupChainedProxies(BrowserUpProxyServer.java:412)
    	at org.littleshoot.proxy.impl.ProxyToServerConnection.create(ProxyToServerConnection.java:199)
    	at org.littleshoot.proxy.impl.ClientToProxyConnection.doReadHTTPInitial(ClientToProxyConnection.java:314)
    	at org.littleshoot.proxy.impl.ClientToProxyConnection.readHTTPInitial(ClientToProxyConnection.java:223)
    	at org.littleshoot.proxy.impl.ClientToProxyConnection.readHTTPInitial(ClientToProxyConnection.java:87)
    	at org.littleshoot.proxy.impl.ProxyConnection.readHTTP(ProxyConnection.java:140)
    	at org.littleshoot.proxy.impl.ProxyConnection.read(ProxyConnection.java:120)
    	at org.littleshoot.proxy.impl.ProxyConnection.channelRead0(ProxyConnection.java:556)
    	at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99)
        ...

Please complete the following information:

  • OS: MacOS
  • Browser: Firefox
  • Version 94.0
@mauromol
Copy link

Yes, it seems like Firefox is producing requests without the protocol and this causes the above exception because httpRequest.uri() is returning a hostname (possibly with port) without any protocol...

@mauromol
Copy link

By the way, this is a duplicate of #258.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants