Kim Alvefur
c506269ff5
Fix various spelling errors (thanks codespell)
...
Also special thanks to timeless, for wordlessly reminding me to check
for typos.
4 years ago
Kim Alvefur
aa9e2741d5
mod_http: Restore ip field for requests without proxies
...
8603011e51fe optimized out more than just the loop, leaving the .ip
field blank when the request wasn't from a proxy.
5 years ago
Kim Alvefur
e52a77ff84
mod_http: Fix trusted proxies check (thanks buildbot)
...
is_trusted_proxy() is only in trunk, I dun goofed when I rebased
8603011e51fe from trunk.
5 years ago
Kim Alvefur
80116bf0e3
mod_http: Skip IP resolution in non-proxied case
...
Skips doing the whole get_ip_from_request() dance if the request isn't
from a proxy at all, even if the client sent the header for some reason.
5 years ago
Kim Alvefur
4b60587e75
mod_http: Consolidate handling of proxied connection details
...
Trying to move everything relating to proxies and X-Forwarded-Foo into a
single place.
5 years ago
Kim Alvefur
2acba62388
net.http.server: Set request.ip so mod_http doesn't have to
...
Because it already sets request.secure, which depends on the connection,
just like the IP, so it makes sense to do both in the same place.
Dealing with proxies can be left to mod_http for now, but maybe it could
move into some util some day?
5 years ago
Kim Alvefur
4ed5700a19
mod_http: Improve message for missing 'route'
...
This was the late night early draft text, thought I had amended this but
apparently I forgot.
5 years ago
Kim Alvefur
19eb907613
mod_http: Warn if app is missing 'route'
...
Makes no sense to have a http module with no handlers
Would have helped me when I accidentally
module:provides("http", {
GET = handler;
})
5 years ago
Kim Alvefur
d65d38846d
mod_http: Allow modifying CORS header list via :provides API
...
E.g.
module:provides("http", {
cors = {
headers = {
Accept = true;
Expect = false;
};
};
route = { ... };
});
Case might be weird.
6 years ago
Kim Alvefur
5d4446cd13
mod_http: Allow setting the CORS credentials flag via :provides API
...
E.g.
module:provides("http", {
cors = {
credentials = true;
};
route = { ... };
});
6 years ago
Kim Alvefur
0e6a6fff96
mod_http: Optimize proxy IP check
...
No need to do a subnet match comparison to see if two IP addresses match
exactly.
5 years ago
Kim Alvefur
362c228c47
mod_http: Consider x-forwarded-proto from trusted proxies
...
Should be better than setting consider_{bosh,websocket}_secure as that
may end up causing actually insecure requests to be considered secure.
Doing it here, as with IP, should make this apply to all HTTP modules.
5 years ago
Matthew Wild
29f2e5906f
mod_http: Silence warnings when running under prosodyctl
5 years ago
Kim Alvefur
933c048829
mod_http: Add way to signal that a module supports streaming uploads
...
Fixes #726
API:
module:provides("http", {
streaming_uploads = true;
route = {
PUT = function (event)
event.request.body_sink = io.tmpfile();
return true;
end
}
})
5 years ago
Kim Alvefur
91d2ab9108
net.http.parser: Allow specifying sink for large request bodies
...
This enables uses such as saving uploaded files directly to a file on
disk or streaming parsing of payloads.
See #726
5 years ago
Boris Grozev
edd798dd98
mod_http: Support CIDR for trusted proxies.
6 years ago
Kim Alvefur
d689f6c9a1
mod_http: Tell luacheck to ignore the long comment lines
6 years ago
Jonas Schäfer
d6de70d19f
mod_http: Add documentation to the non-obvious logic of get_ip_from_request
...
Because docs are good.
6 years ago
Kim Alvefur
0fdb85997a
mod_net_multiplex: Add support for using ALPN
...
Potentially a bit more efficient since it can jump to the selected
protocol on connect instead of waiting for some data to look at.
Adds a 'protocol' field to net providers for this purpose.
6 years ago
Kim Alvefur
6fd9868ed5
mod_http: Log served URLs at 'info' level
...
These are similar to the "activated service" messages from portmanager
and similarily useful for the service admin to know even if they're not
debugging anything.
6 years ago
Kim Alvefur
fd9ccf20d5
mod_http: Soften dependency on mod_http_errors
...
This allows disabling mod_http_errors by adding it to
moduless_disabled and ensures mod_http loads even if the error pages
aren't as pretty.
6 years ago
Kim Alvefur
8340ca2b18
mod_http: Unhook CORS related event handlers
...
Prevents CORS related handlers from being left over on reload.
BC: `mod_http.apps[app_name][event_name]` is now a table instead of the
main handler function.
6 years ago
Matthew Wild
d24e6c7582
mod_http: Add support for configuring CORS Access-Control-Allow-Credentials
6 years ago
Kim Alvefur
2a573e5c5e
mod_http: Make sure path from http_external_url always ends with a slash ( fixes #1183 )
7 years ago
Kim Alvefur
0247a0e904
mod_http: Move normalize_path to util.http
7 years ago
Kim Alvefur
93b55928f6
mod_http: Support global HTTP modules
...
Such modules simply ignore the Host header and always handle the same path.
7 years ago
Kim Alvefur
a31b6728d4
Revert 2dc7490899ae::5d6b252bc36f: Unfinished and broken
7 years ago
Kim Alvefur
7c060d6be5
mod_http: Hook the host-less event if hooked from a global module
7 years ago
Kim Alvefur
c6540b14f9
net.http.server: Move handling of hosts to mod_http
...
Now an event like `GET /path` is fired at first, and mod\_http
dispatches the old `GET host/path` events.
7 years ago
Kim Alvefur
78dbad124a
mod_http: Rename argument to avoid name clash with outer scope [luacheck]
8 years ago
Kim Alvefur
d0f783842e
mod_http: Rename loop variable to avoid name clash [luacheck]
8 years ago
Kim Alvefur
c27c3940c7
mod_http: Rename loop variable to avoid name clash [luacheck]
8 years ago
Kim Alvefur
bf3c8c2b1a
mod_http: Silecence harmless warnings
8 years ago
Kim Alvefur
060ab50b41
mod_http: Pass util.events object to API, fixes traceback
8 years ago
Kim Alvefur
4cdc813fed
mod_http: Set request.ip on all HTTP requests (moves code out of mod_bosh) ( fixes #540 )
8 years ago
Kim Alvefur
a67d0bfb97
util.sslconfig: Remvoe flag merging for 'verify' as this is more of a tri-state field than a set of options
9 years ago
Kim Alvefur
1686ef5d53
mod_http: Allow configuring http parser size limits
9 years ago
Emmanuel Gil Peyrot
2368529f51
mod_http: Fix indentation in redir_handler
10 years ago
Emmanuel Gil Peyrot
c6048a7cb4
Update every link to the documentation to use HTTPS
10 years ago
daurnimator
d7ffd11752
plugins/mod_http: Keep query string over automatic redirects
10 years ago
Matthew Wild
46aa864c3d
Backout unintentional commit ed5440a6ef7f
10 years ago
Matthew Wild
0bd9169930
Merge 0.10->trunk
10 years ago
Kim Alvefur
5efd433b8a
mod_http: Return a static string from module:http_url() when no ports are enabled and log a warning
11 years ago
Kim Alvefur
3550cf7e8e
mod_http: Log a debug message when adding new http apps and warn if no http ports are enabled
11 years ago
Kim Alvefur
272f0cf5e5
Backout 7726b627c3ea
11 years ago
Matthew Wild
45016aef35
mod_http: Log event name when adding a HTTP app's hooks
11 years ago
Kim Alvefur
52642e5699
mod_http: Log name and base URL of HTTP apps
11 years ago
Kim Alvefur
597c04000e
mod_http: For URLs that end with / or wildcard handlers, add a low-priority redirect from without to with slash
11 years ago
Kim Alvefur
b1889326c4
Backed out 35ebcb733c4c
11 years ago
Kim Alvefur
b9350a6264
mod_http: Update to disable peer verification with the new certmanager
12 years ago