Skip to content

Commit fbaad97

Browse files
committed
Added comment
1 parent 298b798 commit fbaad97

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/api/layers/layers-external.api.js

+8
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,10 @@ const ENC_PIPE = '%7C'
165165
*
166166
* This percent encode the special character | used to separate external layer parameters.
167167
*
168+
* NOTE: We don't use encodeURIComponent here because the Vue Router will anyway do the
169+
* encodeURIComponent() therefore by only encoding | we avoid to encode other special character
170+
* twice. But we need to encode | twice to avoid layer parsing issue.
171+
*
168172
* @param {string} param Parameter to encode
169173
* @returns {string} Percent encoded parameter
170174
*/
@@ -177,6 +181,10 @@ export function encodeExternalLayerParam(param) {
177181
*
178182
* This percent decode the special character | used to separate external layer parameters.
179183
*
184+
* NOTE: We don't use decodeURIComponent here because the Vue Router will anyway do the
185+
* decodeURIComponent() therefore by only decoding | we avoid to decode other special character
186+
* twice. But we need to decode | twice to avoid layer parsing issue.
187+
*
180188
* @param {string} param Parameter to encode
181189
* @returns {string} Percent encoded parameter
182190
*/

src/router/storeSync/layersParamParser.js

+8
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ const ENC_AT = '%40'
1010
*
1111
* This percent encode the special character , ; and @ used to separate layer parameters.
1212
*
13+
* NOTE: We don't use encodeURIComponent here because the Vue Router will anyway do the
14+
* encodeURIComponent() therefore by only encoding the layer parameter separators we avoid to encode
15+
* other special character twice. But we need to encode them twice to avoid layer parsing issue.
16+
*
1317
* @param {string} param Parameter to encode
1418
* @returns {string} Percent encoded parameter
1519
*/
@@ -22,6 +26,10 @@ export function encodeLayerParam(param) {
2226
*
2327
* This percent decode the special character , ; and @ used to separate layer parameters.
2428
*
29+
* NOTE: We don't use encodeURIComponent here because the Vue Router will anyway do the
30+
* encodeURIComponent() therefore by only encoding the layer parameter separators we avoid to encode
31+
* other special character twice. But we need to encode them twice to avoid layer parsing issue.
32+
*
2533
* @param {string} param Parameter to encode
2634
* @returns {string} Percent encoded parameter
2735
*/

0 commit comments

Comments
 (0)