Skip to content

Commit

Permalink
Huawei devices use underscore on host names (#95)
Browse files Browse the repository at this point in the history
RFC 952 allows only alpha numeric characters and dashes on host names.
But Huawei android devices use underscore.
This results in an error while communicating with those devices.
  • Loading branch information
syaau authored and mvayngrib committed Jan 1, 2020
1 parent 7b7be6a commit 2bbef63
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions UdpSocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ var Sockets = NativeModules.UdpSockets
var base64 = require('base64-js')
var ipRegex = require('ip-regex')
var normalizeBindOptions = require('./normalizeBindOptions')
// RFC 952 hostname format
var hostnameRegex = /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$/;
// RFC 952 hostname format, except for Huawei android devices that include '_' on their hostnames
var hostnameRegex = /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9_\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9_\-]*[A-Za-z0-9])$/;
var noop = function () {}
var instances = 0
var STATE = {
Expand Down

0 comments on commit 2bbef63

Please sign in to comment.