Changeset 1509 in ntrip


Ignore:
Timestamp:
Jan 19, 2009, 7:25:27 PM (14 years ago)
Author:
mervart
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncnetqueryv2.cpp

    r1463 r1509  
    9090  // Default scheme and path
    9191  // -----------------------
    92   QUrl urlLoc(url);
    93   if (urlLoc.scheme().isEmpty()) {
    94     urlLoc.setScheme("http");
     92  _url = url;
     93  if (_url.scheme().isEmpty()) {
     94    _url.setScheme("http");
    9595  }
    96   if (urlLoc.path().isEmpty()) {
    97     urlLoc.setPath("/");
     96  if (_url.path().isEmpty()) {
     97    _url.setPath("/");
    9898  }
    9999
     
    112112  // ---------------
    113113  QNetworkRequest request;
    114   request.setUrl(urlLoc);
    115   request.setRawHeader("Host"         , urlLoc.host().toAscii());
     114  request.setUrl(_url);
     115  request.setRawHeader("Host"         , _url.host().toAscii());
    116116  request.setRawHeader("Ntrip-Version", "Ntrip/2.0");
    117117  request.setRawHeader("User-Agent"   , "NTRIP BNC/1.7");
    118   if (!urlLoc.userName().isEmpty()) {
     118  if (!_url.userName().isEmpty()) {
     119    QString uName = QUrl::fromPercentEncoding(_url.userName().toAscii());
     120    QString passW = QUrl::fromPercentEncoding(_url.password().toAscii());
    119121    request.setRawHeader("Authorization", "Basic " +
    120            (urlLoc.userName() + ":" + urlLoc.password()).toAscii().toBase64());
     122                         (uName + ":" + passW).toAscii().toBase64());
    121123  }
    122124  if (!gga.isEmpty()) {
Note: See TracChangeset for help on using the changeset viewer.