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
Post a Comment