Mercurial Hosting > luan
view src/goodjava/webserver/Request.java @ 1742:d778f1f2598a
make server side events proxy work
author | Vadim Filimonov <fffilimonov@yandex.ru> |
---|---|
date | Tue, 08 Nov 2022 09:32:46 +0200 |
parents | a02a75e3daa8 |
children |
line wrap: on
line source
package goodjava.webserver; import java.util.Map; import java.util.LinkedHashMap; import java.util.Collections; import goodjava.util.CaseInsensitiveMap; public class Request { public volatile String rawHead; public volatile String method; public volatile String rawPath; public volatile String originalPath; public volatile String path; public volatile String protocol; // only HTTP/1.1 is accepted public volatile String scheme; public final Map<String,Object> headers = Collections.synchronizedMap(new CaseInsensitiveMap<Object>(new LinkedHashMap<String,CaseInsensitiveMap.Value<Object>>())); public final Map<String,Object> parameters = Collections.synchronizedMap(new LinkedHashMap<String,Object>()); public final Map<String,String> cookies = Collections.synchronizedMap(new LinkedHashMap<String,String>()); public volatile byte[] body; public String url() { return scheme + "://" + headers.get("Host") + rawPath; } public static final class MultipartFile { public final String filename; public final String contentType; public final Object content; // byte[] or String public MultipartFile(String filename,String contentType,Object content) { this.filename = filename; this.contentType = contentType; this.content = content; } public String toString() { return "{filename="+filename+", content="+content+"}"; } } }