amphora 8.4.0 → 8.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/render.js +5 -1
- package/package.json +1 -1
package/lib/render.js
CHANGED
|
@@ -286,7 +286,11 @@ function renderExpressRoute(req, res, next) {
|
|
|
286
286
|
var hrStart = process.hrtime(),
|
|
287
287
|
site = res.locals.site,
|
|
288
288
|
prefix = `${getExpressRoutePrefix(site)}/_uris/`,
|
|
289
|
-
|
|
289
|
+
// We're using decodeURIComponent to match any encoded value that might be sent by the browser.
|
|
290
|
+
// An example of this is a smart quote ’ -- That value is going to be encoded to `%E2%80%99`.
|
|
291
|
+
// We store the actual symbol in our database, not the encoded value, so, when decoding it, we ensure we can get the direct symbol
|
|
292
|
+
// and, in consequence, the page we're looking for.
|
|
293
|
+
pageReference = `${prefix}${buf.encode(req.hostname + req.baseUrl + decodeURIComponent(req.path))}`;
|
|
290
294
|
|
|
291
295
|
return module.exports.renderUri(pageReference, req, res, hrStart)
|
|
292
296
|
.catch((error) => {
|