Added URL URLs Normalization

Signed-off-by: Avior <florian.bouillon@delta-wings.net>
This commit is contained in:
Florian Bouillon 2021-05-07 10:16:42 +02:00
parent 4597476e6b
commit 6c5fc609ae
Signed by: Florian Bouillon
GPG Key ID: 50BD648F12C86AB6

View File

@ -71,6 +71,9 @@ export default class TCGdex {
} }
private rwgr<T = any>(...url: Array<string | number>) { private rwgr<T = any>(...url: Array<string | number>) {
return RequestWrapper.getRequest<T>(`${this.getBaseUrl()}/${url.map((v) => encodeURI(v.toString())).join('/')}`) return RequestWrapper.getRequest<T>(`${this.getBaseUrl()}/${url.map((v) => encodeURI(
// Normalize URL
v.toString().replace('?', '%3F').normalize('NFC').replace(/["'\u0300-\u036f]/g, "")
)).join('/')}`)
} }
} }