private IsKnownFile ( string localPath ) : bool | ||
localPath | string | |
return | bool |
public bool IsKnownFile(string localPath)
{
if (IsKnown(localPath, StatLightServiceRestApi.CrossDomain))
return true;
if (IsKnown(localPath, StatLightServiceRestApi.ClientAccessPolicy))
return true;
if (IsKnown(localPath, StatLightServiceRestApi.GetHtmlTestPage))
return true;
if (IsKnown(localPath, StatLightServiceRestApi.GetTestPageHostXap))
return true;
if (IsKnown(localPath, StatLightServiceRestApi.GetTestRunConfiguration))
return true;
return false;
}
private void ProcessGetRequest(HttpListenerRequest request, HttpListenerResponse response) { try { var localPath = GetLocalPath(request); if (_responseFactory.IsKnownFile(localPath)) { var responseFile = _responseFactory.Get(localPath); SetHttpStatus(response, HttpStatusCode.OK); SetContentType(response, responseFile.ContentType); ServeString(response, responseFile.FileData); } else { HandleUnknownRequest(request, response); } } catch (Exception exception) { _logger.Debug(exception.ToString()); } }