Skip to content

Add support and tests for URLComponents.percentEncodedQueryItems #2929

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions CoreFoundation/URL.subproj/CFURLComponents.c
Original file line number Diff line number Diff line change
Expand Up @@ -1282,7 +1282,7 @@ static CFArrayRef _CFURLComponentsCopyQueryItemsInternal(CFURLComponentsRef comp
}
}
else {
nameString = CFSTR("");
nameString = CFRetain(CFSTR(""));
}
CFTypeRef keys[] = {_kCFURLComponentsNameKey};
CFTypeRef values[] = {nameString};
Expand Down Expand Up @@ -1343,7 +1343,7 @@ static CFArrayRef _CFURLComponentsCopyQueryItemsInternal(CFURLComponentsRef comp
}
}
else {
nameString = CFSTR("");
nameString = CFRetain(CFSTR(""));
}
CFTypeRef keys[] = {_kCFURLComponentsNameKey};
CFTypeRef values[] = {nameString};
Expand Down Expand Up @@ -1464,6 +1464,8 @@ static Boolean _CFURLComponentsSetQueryItemsInternal(CFURLComponentsRef componen
return ( result );
}



CF_EXPORT void _CFURLComponentsSetQueryItems(CFURLComponentsRef components, CFArrayRef names, CFArrayRef values ) {
(void)_CFURLComponentsSetQueryItemsInternal(components, names, values, true); // _CFURLComponentsSetQueryItemsInternal cannot fail if addPercentEncoding is true
}
Expand Down
Loading