Re: [jetty-users] org.eclipse.jetty.http.HttpField

2020-10-30 Thread Nils Kilden-Pedersen


On Fri, Oct 30, 2020 at 3:45 AM Greg Wilkins  wrote:

>
> So wrote this test code:
>
> public void testEtag()
> {
> HttpFields fields = new HttpFields();
> fields.add("ETag", "W/\"1\",W/2");
> fields.add("ETag", "W/\"3\"");
>
> System.err.println("Collections.list(fields.getValues(\"Etag\"))");
> Collections.list(fields.getValues("Etag")).forEach(System.err::println);
> System.err.println("Collections.list(fields.getValues(\"Etag\", \",\"))");
> Collections.list(fields.getValues("Etag", 
> ",")).forEach(System.err::println);
> System.err.println("fields.getCSV(\"Etag\", false)");
> fields.getCSV("Etag", false).forEach(System.err::println);
> System.err.println("fields.getCSV(\"Etag\", true)");
> fields.getCSV("Etag", true).forEach(System.err::println);
> }
>
> which cage the output:
>
> Collections.list(fields.getValues("Etag"))
> W/"1",W/2
> W/"3"
> Collections.list(fields.getValues("Etag", ","))
> W/1
> W/2
> W/3
> fields.getCSV("Etag", false)
> W/1
> W/2
> W/3
> fields.getCSV("Etag", true)
> W/"1"
> W/2
> W/"3"
>
>
> So fields.getCSV("Etag", true) is the method you want.
> Note also that fields.getValues("Etag", ",") is deprecated!
>
> --
> Greg Wilkins  CTO http://webtide.com
> ___
> jetty-users mailing list
> jetty-users@eclipse.org
> To unsubscribe from this list, visit
> https://www.eclipse.org/mailman/listinfo/jetty-users
>
___
jetty-users mailing list
jetty-users@eclipse.org
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/jetty-users


Re: [jetty-users] org.eclipse.jetty.http.HttpField

2020-10-30 Thread Greg Wilkins
So wrote this test code:

public void testEtag()
{
HttpFields fields = new HttpFields();
fields.add("ETag", "W/\"1\",W/2");
fields.add("ETag", "W/\"3\"");

System.err.println("Collections.list(fields.getValues(\"Etag\"))");
Collections.list(fields.getValues("Etag")).forEach(System.err::println);
System.err.println("Collections.list(fields.getValues(\"Etag\", \",\"))");
Collections.list(fields.getValues("Etag",
",")).forEach(System.err::println);
System.err.println("fields.getCSV(\"Etag\", false)");
fields.getCSV("Etag", false).forEach(System.err::println);
System.err.println("fields.getCSV(\"Etag\", true)");
fields.getCSV("Etag", true).forEach(System.err::println);
}

which cage the output:

Collections.list(fields.getValues("Etag"))
W/"1",W/2
W/"3"
Collections.list(fields.getValues("Etag", ","))
W/1
W/2
W/3
fields.getCSV("Etag", false)
W/1
W/2
W/3
fields.getCSV("Etag", true)
W/"1"
W/2
W/"3"


So fields.getCSV("Etag", true) is the method you want.
Note also that fields.getValues("Etag", ",") is deprecated!

-- 
Greg Wilkins  CTO http://webtide.com
___
jetty-users mailing list
jetty-users@eclipse.org
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/jetty-users


Re: [jetty-users] Enabling all ipv4 and ipv6 for a connector

2020-10-30 Thread Simone Bordet
Hi,

On Fri, Oct 30, 2020 at 8:45 AM Pavan Patel  wrote:
>
> Hi all,
>
> In my product we are using the embedded jetty server - 9.4.11 and we have a 
> requirement for jetty to listen on all ipv4 and ipv6 ips. Currently we 
> configure connector for host 0.0.0.0, so all ipv4 ip's it listens to, but not 
> for all ipv6. Is there a way to configure a connector for 0.0.0.0 (all ipv4) 
> and ::/0 (all ipv6).

Just don't specify the host Jetty binds to, and the default is already
to bind to both the IPv4 and the IPv6 any address (that's what the JVM
does by default unless you force it to use only IPv4).

-- 
Simone Bordet

http://cometd.org
http://webtide.com
Developer advice, training, services and support
from the Jetty & CometD experts.
___
jetty-users mailing list
jetty-users@eclipse.org
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/jetty-users