mirror of
https://github.com/wgh136/nysoure.git
synced 2025-09-27 20:27:23 +00:00
Encode usernames in API requests and navigation links to handle special characters.
This commit is contained in:
@@ -581,7 +581,7 @@ class Network {
|
||||
): Promise<PageResponse<Resource>> {
|
||||
try {
|
||||
const response = await axios.get(
|
||||
`${this.apiBaseUrl}/resource/user/${username}`,
|
||||
`${this.apiBaseUrl}/resource/user/${encodeURIComponent(username)}`,
|
||||
{
|
||||
params: {
|
||||
page,
|
||||
@@ -978,7 +978,7 @@ class Network {
|
||||
): Promise<PageResponse<CommentWithResource>> {
|
||||
try {
|
||||
const response = await axios.get(
|
||||
`${this.apiBaseUrl}/comments/user/${username}`,
|
||||
`${this.apiBaseUrl}/comments/user/${encodeURIComponent(username)}`,
|
||||
{
|
||||
params: { page },
|
||||
},
|
||||
|
Reference in New Issue
Block a user