Opened 15 years ago
Closed 15 years ago
#10231 closed defect (bug) (fixed)
missing hook in WP_HTTP
Reported by: | Denis-de-Bernardy | Owned by: | dd32 |
---|---|---|---|
Milestone: | 2.8.1 | Priority: | normal |
Severity: | normal | Version: | 2.8 |
Component: | HTTP API | Keywords: | has-patch tested commit |
Focuses: | Cc: |
Description
see attached patch.
the missing hook allows to stop a nascent request (e.g. due to a coming 403 related to an expired membership) before it occurs.
Attachments (1)
Change History (11)
#4
in reply to:
↑ 1
@
15 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
Replying to dd32:
What is the point of the added WP_Error check?
Is there a reason to advertise the possibility of returning a non-array via it?
If you know, based on transients, that the url will return junk (a 302 to a login form, for instance), there currently isn't any means to make WP stop then and there.
#5
@
15 years ago
- Summary changed from missing localization + missing hook in WP_HTTP to missing hook in WP_HTTP
#6
@
15 years ago
there currently isn't any means to make WP stop then and there.
No.. No there isnt.. Remind me again, Whats the point of that? Why would something be requesting it if it knew it was a dud url? Put your check in your code.. not in the API.
#7
@
15 years ago
Duh, I certainly would, if such a hook existed in the first place. ;-)
The http request in question is for a core update...
#8
@
15 years ago
It's like... I would offer a patch that places them where I'd like to see them, but it makes a lot more sense to add a generic one right in the http request args. It makes things a *lot* more generic.
#9
@
15 years ago
Some IRC logs:
jacobsantos Dude, HTTP has such a large overhead already. 3:23 AM Which is partly way I didn't do it in the first place. 3:24 AM Well, given the ratio of plugin API verses HTTP request, there really isn't a comparsion. 3:24 AM Be like 1:10000000000 or something. 3:24 AM Well, localization does have a higher overhead than the Plugin API. 3:25 AM ddebernardy right 3:25 AM and this hook actually improves the overhead 3:25 AM since a plugin can then prevent the HTTP request before it's even triggered 3:26 AM I mean, heck, consider it for a moment 3:26 AM http request to a protected zip file 3:26 AM which redirects, using a 302, to a login form 3:26 AM WP diligently downloads the form, and tries to unzip it 3:26 AM sure I could manage this on my server 3:26 AM and check the user agent 3:26 AM but it's ridiculous 3:27 AM one hook in there, and users get the correct error, i.e. "time to renew your membership" 3:27 AM without a request in the first place 3:27 AM whereas, without it, they get an error (bad zip) 3:27 AM and I get a support request
What is the point of the added WP_Error check?
Is there a reason to advertise the possibility of returning a non-array via it?