Redirect http server request in Dart, but uri.host is blank -


मुझे मिला है:

  server.listen ((HttpRequest अनुरोध) {प्रिंट ( Request.uri.toString ()); अगर (request.uri.host == "woven.app") {request.response.redirect (नई उरी (योजना: 'http', होस्ट: 'बुने.को', पथ: Request.uri.path, fragment: request.uri.fragment))}}   

लेकिन लाइन 2 रिटर्न रिक्त है request.uri के नोट के अनुसार : <प्री> * प्राधिकरण घटक का मेजबान भाग लौटाता है। * * यदि कोई प्राधिकरण घटक नहीं है और * इसलिए कोई मेजबान नहीं है। < P> अद्यतन करें: यह स्थानीय रूप से और सर्वर पर, क्रोम के साथ परीक्षण किया गया है।

यह ठीक से देता है होस्ट नाम:

  request.headers.host   

यह काम क्यों करता है जबकि request.uri.host नहीं करता है?

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -