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

HTTP Server should not rely on File System #86443

Open
phb98 opened this issue Feb 28, 2025 · 0 comments · May be fixed by #86450
Open

HTTP Server should not rely on File System #86443

phb98 opened this issue Feb 28, 2025 · 0 comments · May be fixed by #86450
Assignees
Labels
area: Networking Enhancement Changes/Updates/Additions to existing features

Comments

@phb98
Copy link

phb98 commented Feb 28, 2025

Is your enhancement proposal related to a problem? Please describe.

Currently in http2 implementation (http_server_http2.c)

 else if (detail->type == HTTP_RESOURCE_TYPE_STATIC_FS) {
			ret = handle_http2_static_fs_resource(
				(struct http_resource_detail_static_fs *)detail, frame, client);
			if (ret < 0) {
				goto error;
			}

This assumes the system have file system, which is not always true. Also http server should work without File system.
http1 implementation already has guard for this case, but this is not in http2

#if defined(CONFIG_FILE_SYSTEM)
		} else if (detail->type == HTTP_RESOURCE_TYPE_STATIC_FS) {
			ret = handle_http1_static_fs_resource(
				(struct http_resource_detail_static_fs *)detail, client);
			if (ret < 0) {
				goto error;
			}
#endif

Describe the solution you'd like

Add #ifdef guard around fs type resource, and make sure http can compile without filesystem

Additional context

CONFIG_HTTP_SERVER will include 2 http implementation of http, not sure if http2 is needed if we only need http/1.1 and below

zephyr_library_sources_ifdef(CONFIG_HTTP_SERVER http_server_core.c
						http_server_http1.c
						http_server_http2.c
						http_hpack.c
						http_huffman.c)
@phb98 phb98 added the Enhancement Changes/Updates/Additions to existing features label Feb 28, 2025
@phb98 phb98 linked a pull request Feb 28, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Networking Enhancement Changes/Updates/Additions to existing features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants