refactor: remove deprecations in HTTP#10000
refactor: remove deprecations in HTTP#10000paulbalandan wants to merge 1 commit intocodeigniter4:4.8from
Conversation
Haha, love the dedication 😆 I'm a little concerned about removing |
The deprecation was made in #7252 , mainly because it's not in PSR-7. Do you mean to "un-deprecate" it? |
|
Well, the reason in the comment ("Method not in PSR-7") isn't very fortunate, because PSR-7 allows extra methods. The real problem is immutability and hidden behavioral state. Since |
|
Okay, I'll retain it and add a hard deprecation notice on it. For the |
|
Yes, thank you! |
This comment was marked as resolved.
This comment was marked as resolved.
dafeec6 to
b78452e
Compare
b78452e to
86330c2
Compare
system/HTTP/CURLRequest.php
Outdated
| { | ||
| if (array_key_exists('baseURI', $options)) { | ||
| $this->baseURI = $this->baseURI->setURI($options['baseURI']); | ||
| $this->baseURI = new URI($options['baseURI']); |
There was a problem hiding this comment.
This is also problematic. In the constructor, we call $uri->useRawQueryString(), which prevents the use of parse_str(). This is important because parse_str() would modify query parameters - for example, converting http://example.com/?foo.bar=baz into foo_bar=baz.
There was a problem hiding this comment.
Hmm, since useRawQueryString() is not in PSR 7, how about putting that as the 2nd argument in URI's constructor, call here with true, then deprecate useRawQueryString()?
There was a problem hiding this comment.
I'm fine with adding this to the constructor. Deprecating useRawQueryString() would also make sense, as the parsing behavior would be fixed at construction time. Although I'm not sure if this would be a problem in the long run, probably no one is using this feature elsewhere.
There was a problem hiding this comment.
I figured in the docs, it can be called before using setQueryArray(), so making it constructor-only seems an unnecessary break. Instead, I just called useRawQueryString() immediately after instantiation.
There was a problem hiding this comment.
This will not work if the baseURI has a query. This is too late, as the constructor has already run through setQuery().
This comment was marked as resolved.
This comment was marked as resolved.
86330c2 to
8b51137
Compare
Description
Sending this early to get the
#10000slot. 😂This is not yet complete, but initially there are quite breaking changes:
Removed the deprecated assumption that URIs with the same host as baseURL should be relative to the project's configuration (deprecated by Internal URI handling #4646 and reinforced in fix: forceGlobalSecureRequests break URI schemes other than HTTP #5730)URI::setSilent()is removed, meaning it will always throw exceptions on invalid URIs instead of continuing.Checklist: