
io.muserver.handlers.ResourceCustomizer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mu-server Show documentation
Show all versions of mu-server Show documentation
A simple but powerful web server framework
The newest version!
package io.muserver.handlers;
import io.muserver.Headers;
import io.muserver.MuRequest;
/**
* A hook to change responses for static resources.
* This is primarily used to customize the headers of static files. Register this hook with {@link ResourceHandlerBuilder#withResourceCustomizer(ResourceCustomizer)}
*/
public interface ResourceCustomizer {
/**
* Called after the default headers have been set, just before they are sent to the client. Changing the passed in
* headers map will change the response headers sent to the client.
* @param request The client request
* @param responseHeaders The headers that will be sent to the client, which can be modified in this method
*/
default void beforeHeadersSent(MuRequest request, Headers responseHeaders) {};
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy