MCPcopy Create free account
hub / github.com/apache/cloudstack / encodeUriSegment

Function encodeUriSegment

tools/ngui/static/js/lib/angular.js:857–862  ·  view source on GitHub ↗

* We need our custom method because encodeURIComponent is too aggressive and doesn't follow * http://www.ietf.org/rfc/rfc3986.txt with regards to the character set (pchar) allowed in path * segments: * segment = *pchar * pchar = unreserved / pct-encoded / sub-delims / ":" / "

(val)

Source from the content-addressed store, hash-verified

855 * / "*" / "+" / "," / ";" / "="
856 */
857function encodeUriSegment(val) {
858 return encodeUriQuery(val, true).
859 replace(/%26/gi, '&').
860 replace(/%3D/gi, '=').
861 replace(/%2B/gi, '+');
862}
863
864
865/**

Callers 3

encodePathFunction · 0.85
LocationUrlFunction · 0.85
LocationHashbangUrlFunction · 0.85

Calls 2

encodeUriQueryFunction · 0.85
replaceMethod · 0.80

Tested by

no test coverage detected