2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-08 17:22:34 +03:00

Enhanced protocol parsing implementation to fix #4633; (#4639)

Added unit tests;

Co-authored-by: Jay <jasonsaayman@gmail.com>
This commit is contained in:
Dmitriy Mozgovoy
2022-04-27 12:30:50 +03:00
committed by GitHub
parent 76432c18be
commit b9e9fb4fa0
3 changed files with 32 additions and 2 deletions
+6
View File
@@ -0,0 +1,6 @@
'use strict';
module.exports = function parseProtocol(url) {
var match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
return match && match[1] || '';
};