-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ipv6 result in PUB malfunction #21698
Comments
From the stack trace, this looks like an error in dart:io's [_HttpRequest.requestedUri]. Removed Area-Pub label. |
This is caused in the generation of requestedUrl. However this results from an "illegal" Host header being used in the request. As the request is coming from the dart:io HTTP client the root cause of the bug is there. Proposed fix in https://codereview.chromium.org/755883007/. We could also try to make the handling in requestedUrl more resilient, but if a Host header is set without the address in square brackets there is not deterministic way to always figure out whether the component after the last colon is the port. The following Host header 8080::8080:8080 Could mean both of 8080:0:0:0:0:0.8080:8080 port 80 Background: According to the URI specification IPv6 addresses must be encapsulated in square brackets. So the following curl request is "correct": $ curl "http://[::]:8080/path" whereas this is not: $ curl http://:::8080/path Browsers does not allow the URL "http://:::8080/path" to be used for a request. The second curl request will still cause an exception in HttpRequest.requestedUri. 8080::8080:8080 |
Fixed in 41980 (https://code.google.com/p/dart/source/detail?r=41980). Added Fixed label. |
Follow-up fix to test on Windows in https://code.google.com/p/dart/source/detail?r=41981. |
This issue was originally filed by Denis.S.M...@gmail.com
What steps will reproduce the problem?
ifconfig
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
options=3<RXCSUM,TXCSUM>
inet6 ::1 prefixlen 128
inet 127.0.0.1 netmask 0xff000000
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
nd6 options=1<PERFORMNUD>
What is the expected output? What do you see instead?
PUB would fail as it'll try to request urls from first (IPv6) address via http :
FINE: Loading transformers from [chrome]
IO : Created temp directory /var/folders/s1/lsm7y1kx21j2p68bxczstm380000gp/T/pub_hWgPJS
IO : Writing 175 characters to text file /var/folders/s1/lsm7y1kx21j2p68bxczstm380000gp/T/pub_hWgPJS/runInIsolate.dart.
ERR : Invalid character (at character 8)
| http://::1:62057/packages/barback/src/asset/asset_set.dart
| ^
FINE: Exception type: FormatException
ERR : dart:io _HttpRequest.requestedUri
| package:shelf/shelf_io.dart 107 _fromHttpRequest
| package:shelf/shelf_io.dart 56 handleRequest
| package:shelf/shelf_io.dart 46 serveRequests.<fn>.<fn>
| dart:isolate _RawReceivePortImpl._handleMessage
What version of the product are you using?
Dart VM version: 1.7.2 (Tue Oct 14 06:58:25 2014) on "macos_x64"
On what operating system?
OS X 10.9.4
What browser (if applicable)?
Please provide any additional information below.
The issue is resolved when you manually remove IPv6 addresses from loopback interface. But it need be properly handled by PUB itself
sudo ifconfig lo0 inet6 ::1 delete
sudo ifconfig lo0 inet6 fe80::1%lo0 delete
The text was updated successfully, but these errors were encountered: