Bêta-test Duniter 1.6 WS2P

Non je ne l’ai pas prévu dans la RegExp, tu peux tester dans ta console JS :

"WS2P fb17fcd4 g1.duniter.fr/ws2p 443".match(/^WS2P ([a-f0-9]{8}) ([a-z_][a-z0-9-_.]*|[0-9.]+|[0-9a-f:]+) ([0-9]+)( (.+))?$/)
=> null

Par contre il est encore possible de modifier la RegExp en autorisant un path de façon optionnelle :

"WS2P fb17fcd4 g1.duniter.fr 443 /ws2p".match(/^WS2P ([a-f0-9]{8}) ([a-z_][a-z0-9-_.]*|[0-9.]+|[0-9a-f:]+) ([0-9]+)( (.+))?$/)
=> (6) ["WS2P fb17fcd4 g1.duniter.fr 443 /ws2p", "fb17fcd4", "g1.duniter.fr", "443", " /ws2p", "/ws2p", index: 0, input: "WS2P fb17fcd4 g1.duniter.fr 443 /ws2p"]

Je fais bien de ne pas précipiter la release :slight_smile:

1 Like