Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

修复用url pathComponents 解释的时候出现的bug #9

Merged
merged 1 commit into from
Apr 29, 2015

Conversation

xcxcxc
Copy link

@xcxcxc xcxcxc commented Sep 5, 2014

上次修改成用 [[NSURL URLWithString:route] pathComponents] 出现了一个bug....
NSSRL 和 NSString 的pathComponents 开头是2个"//" 的结果居然是不同的...@_@

po [[NSURL URLWithString:@"//gamevideodetail/53f44b23aa590571d70c9ce2"] pathComponents]
<__NSArrayM 0xeb71230>(
/,
53f44b23aa590571d70c9ce2
)

po [[NSURL URLWithString:@"/gamevideodetail/53f44b23aa590571d70c9ce2"] pathComponents]
<__NSArrayM 0xd7eeae0>(
/,
gamevideodetail,
53f44b23aa590571d70c9ce2
)

po [@"/gamevideodetail/53f44b23aa590571d70c9ce2" pathComponents]
<__NSArrayM 0xd3521f0>(
/,
gamevideodetail,
53f44b23aa590571d70c9ce2
)

po [@"//gamevideodetail/53f44b23aa590571d70c9ce2" pathComponents]
<__NSArrayM 0xd38d6c0>(
/,
gamevideodetail,
53f44b23aa590571d70c9ce2
)

@pyrou
Copy link

pyrou commented Feb 3, 2015

This fix introduced a new bug :

po [[NSURL URLWithString:@"/test/25?param=value"] pathComponents]
<__NSArrayM 0x7facb5930300>(
/,
test,
25
)
po [@"/test/25?param=value" pathComponents]
<__NSArrayM 0x7facb25ceeb0>(
/,
test,
25?param=value
)

That will not match the route /test/:id

@pyrou pyrou mentioned this pull request Feb 3, 2015
@xcxcxc
Copy link
Author

xcxcxc commented Feb 3, 2015

xcxcxc@118cf7d

This commit can solution.

pyrou added a commit to pyrou/HHRouter that referenced this pull request Feb 18, 2015
- adding non-regression Tests for PR lightory#9
pyrou added a commit to pyrou/HHRouter that referenced this pull request Feb 18, 2015
- adding non-regression Tests for PR lightory#9
smhjsw added a commit that referenced this pull request Apr 29, 2015
修复用url pathComponents 解释的时候出现的bug
@smhjsw smhjsw merged commit dd982d2 into lightory:master Apr 29, 2015
HarrisonXi pushed a commit to HarrisonXi/ABRouter that referenced this pull request Apr 10, 2019
修复用url pathComponents 解释的时候出现的bug
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