Skip to content

search 파라미터 이중 인코딩 제거#35

Merged
yongholeeme merged 3 commits intomainfrom
search_encode
Oct 24, 2024
Merged

search 파라미터 이중 인코딩 제거#35
yongholeeme merged 3 commits intomainfrom
search_encode

Conversation

@yongholeeme
Copy link
Copy Markdown
Contributor

@yongholeeme yongholeeme commented Oct 24, 2024

우당탕탕..

  • 이중 인코딩 되는 부분을 수정합니다.
  • search setter 동작에는 인코딩이 필요없어 제거합니다.

@yongholeeme yongholeeme self-assigned this Oct 24, 2024
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Oct 24, 2024

🦋 Changeset detected

Latest commit: 95cf37d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@naverpay/nurl Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Comment thread src/nurl.ts
Comment on lines -229 to +230
const encodedSearch = encodeURI(search)
this._search = encodedSearch.startsWith('?') ? encodedSearch : `?${encodedSearch}`
this._searchParams = new URLSearchParams(encodedSearch)
this._search = search.startsWith('?') ? search : `?${search}`
this._searchParams = new URLSearchParams(search)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아 여기서 두번하고 있었네요 ㅋㅋ

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

searchParams 는 내부적으로 하고 있어서 객체 생성할 때, search 인코딩을 하고 있어서 여기서 두 번 하고 있었습니다.
(setter에서는 필요없었음)

Copy link
Copy Markdown

@yceffort yceffort left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아직 1.0.0 아니니깐

Copy link
Copy Markdown
Contributor

@yceffort-naver yceffort-naver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

가즈앗

@yongholeeme yongholeeme merged commit 5bc4071 into main Oct 24, 2024
@yongholeeme yongholeeme deleted the search_encode branch October 24, 2024 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants