Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix(sanitizeURIComponent): sanitize url escaping #137

Merged
merged 2 commits into from
Jan 9, 2023
Merged

Conversation

antfu
Copy link
Member

@antfu antfu commented Jan 8, 2023

When you compose your Vue component like:

<script setup lang="ts" generic="T extends any, O extends any">
// ...
</script>

its id will be served as Foo.vue?vue&type=script&setup=true&generic=T%20extends%20any%2C%20O%20extends%20T%3CZ%7Ca%3E&lang

in which sanitizeURIComponent is not able to sanitize %20 making it writes to filename. In that sense, breaking the production build of Nuxt as the browser will interop the URL as a space (404).

& further discussion: #138

@codecov
Copy link

codecov bot commented Jan 8, 2023

Codecov Report

Merging #137 (cd923fa) into main (615db53) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #137      +/-   ##
==========================================
+ Coverage   68.52%   68.55%   +0.02%     
==========================================
  Files          13       13              
  Lines        2418     2420       +2     
  Branches      252      252              
==========================================
+ Hits         1657     1659       +2     
  Misses        756      756              
  Partials        5        5              
Impacted Files Coverage Δ
src/utils.ts 83.58% <100.00%> (+0.50%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@danielroe danielroe requested a review from pi0 January 9, 2023 09:18
@pi0 pi0 merged commit f91da0d into main Jan 9, 2023
@pi0 pi0 deleted the fix/url-escape branch January 9, 2023 10:57
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants