0
我有:在DART重定向HTTP服務器請求,但uri.host是空白
server.listen((HttpRequest request) {
print(request.uri.toString());
if (request.uri.host == "woven.app") {
request.response.redirect(new Uri(scheme: 'http', host: 'woven.co',
path: request.uri.path, fragment: request.uri.fragment));
}
...
但2號線返回空白。按照筆記request.uri
:
* Returns the host part of the authority component.
*
* Returns the empty string if there is no authority component and
* hence no host.
UPDATE:這是本地和服務器的情況下,Chrome瀏覽器測試。