You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
else// The Remote Server is configured to respond on one specific address rather than on all of its IP addresses so test whether the received message is on the selected IP address
882
882
{
883
-
if(DebugTraceState)LogMessage((uint)discoveryNumber,0,0,"DiscoveryCallback",$"Request received on endpoint: {localIpEndPoint} - Enabled endpoint: {newIPEndPoint(IPAddress.Parse(ServerIPAddressString),(int)AlpacaDiscoveryPort).ToString()}");
883
+
if(DebugTraceState)LogMessage((uint)discoveryNumber,0,0,"DiscoveryCallback",$"Request received on endpoint: {localIpEndPoint} - Enabled endpoint: {newIPEndPoint(IPAddress.Parse(ServerIPAddressString),(int)AlpacaDiscoveryPort)}");
884
884
if(localIpEndPoint.ToString()!=newIPEndPoint(IPAddress.Parse(ServerIPAddressString),(int)AlpacaDiscoveryPort).ToString())// IP Addresses don't match so we just ignore the request
885
885
{
886
886
if(DebugTraceState)LogMessage((uint)discoveryNumber,0,0,"DiscoveryCallback",$" The endpoint is NOT enabled - This request will be dropped.");
ServerForm.LogMessage((uint)discoveryNumber,0,0,"DiscoveryCallback",$"Received a version {discoveryBroadcastVersionNumber} (0x{((int)Char.GetNumericValue(discoveryBroadcastVersionNumber)).ToString("X")}) discovery packet from the client IP address {remoteEndpoint.Address} of type {remoteEndpoint.AddressFamily}. Returning Alpaca port number: {ServerPortNumber}");
910
+
ServerForm.LogMessage((uint)discoveryNumber,0,0,"DiscoveryCallback",$"Received a version {discoveryBroadcastVersionNumber} (0x{(int)Char.GetNumericValue(discoveryBroadcastVersionNumber):X}) discovery packet from the client IP address {remoteEndpoint.Address} of type {remoteEndpoint.AddressFamily}. Returning Alpaca port number: {ServerPortNumber}");
911
911
912
912
// Create a discovery response, convert it to JSON and return this to the caller
913
913
AlpacaDiscoveryResponsealpacaDiscoveryResponse=newAlpacaDiscoveryResponse((int)ServerPortNumber);// Create the response object
LogException(0,0,0,"CreateInstance",$"Error setting Connected to true for focuser device {configuredDevice.Value.ProgID} now trying Link for IFocuserV1 devices: \r\n{ex2.ToString()}");
981
+
LogException(0,0,0,"CreateInstance",$"Error setting Connected to true for focuser device {configuredDevice.Value.ProgID} now trying Link for IFocuserV1 devices: \r\n{ex2}");
// User has configured a specific IP address so test whether this request is to the configured IP address
1767
-
if(DebugTraceState)LogMessage1(requestData,"APIRequestCallback",$"Request received on endpoint: {localIpEndPoint.ToString()} - Enabled endpoint: {newIPEndPoint(IPAddress.Parse(ServerIPAddressString),(int)ServerPortNumber).ToString()}");
1767
+
if(DebugTraceState)LogMessage1(requestData,"APIRequestCallback",$"Request received on endpoint: {localIpEndPoint} - Enabled endpoint: {newIPEndPoint(IPAddress.Parse(ServerIPAddressString),(int)ServerPortNumber)}");
1768
1768
if(localIpEndPoint.ToString()!=newIPEndPoint(IPAddress.Parse(ServerIPAddressString),(int)ServerPortNumber).ToString())// IP Addresses don't match so we just ignore the request
1769
1769
{
1770
1770
if(DebugTraceState)LogMessage1(requestData,"APIRequestCallback",$" The endpoint is NOT enabled - This request will be dropped.");
if(request.HttpMethod.ToUpperInvariant()=="OPTIONS")// This is a CORS pre-flight request so we need to set some specific headers
1987
1987
{
1988
1988
// Set the Access-Control-Allow-Methods and Access-Control-Max-Age headers
1989
-
if(DebugTraceState)LogMessage1(requestData,SharedConstants.REQUEST_RECEIVED_STRING,$"OPTIONS method found - This is a CORS PRE_FLIGHT request: {CORS_ALLOWED_METHODS_HEADER} = {CORS_ALLOWED_METHODS}, {CORS_MAX_AGE_HEADER} = {CorsMaxAge.ToString()}");
1989
+
if(DebugTraceState)LogMessage1(requestData,SharedConstants.REQUEST_RECEIVED_STRING,$"OPTIONS method found - This is a CORS PRE_FLIGHT request: {CORS_ALLOWED_METHODS_HEADER} = {CORS_ALLOWED_METHODS}, {CORS_MAX_AGE_HEADER} = {CorsMaxAge}");
0 commit comments