[ejabberd] Error: REST request is rejected by service

David Cunningham dcunningham at voisonics.com
Mon Jul 25 15:08:57 MSK 2016


Thanks James and Badlop for the replies.

I get the same response when using the wget as Badlop suggested. Wget
provides an Accept header of "Accept: */*", and it doesn't work if I force
it's header to "Accept: application/xml".

Here's the ejabberd log with debug level set:

2016-07-25 03:43:18.349 [info] <0.577.0>@ejabberd_listener:accept:333
(#Port<0.18713>) Accepted connection XX.XX.246.78:42376 -> XX.XX.246.78:5285
2016-07-25 03:43:18.349 [debug] <0.597.0>@ejabberd_http:init:154 S:
[{[<<"rest">>],mod_rest}]
2016-07-25 03:43:18.349 [info] <0.597.0>@ejabberd_http:init:158 started:
{gen_tcp,#Port<0.18713>}
2016-07-25 03:43:18.349 [debug] <0.597.0>@ejabberd_http:process_header:281
(#Port<0.18713>) http query: 'POST' <<"/rest">>
2016-07-25 03:43:18.349 [debug]
<0.597.0>@ejabberd_http:extract_path_query:395 client data: <<"<presence
to=\"david at foo.com\" from=\"dcunningham at foo.com\"><status>On the
phone</status></presence>">>
2016-07-25 03:43:18.349 [debug] <0.597.0>@ejabberd_http:process:353
[<<"rest">>] matches [<<"rest">>]
2016-07-25 03:43:18.349 [debug] <0.597.0>@mod_rest:process:55 Error when
processing REST request:
Data: <<"<presence to=\"david at foo.com\" from=\"dcunningham at foo.com\"><status>On
the phone</status></presence>">>
Error: {badmatch,false}

I've done a lot of playing with the configuration but can't get past this
"406 Not Acceptable" problem. Any advice appreciated.


On 22 July 2016 at 23:11, James Tait <james.tait at wyrddreams.org> wrote:

> On 22/07/16 06:52, David Cunningham wrote:
>
> Hi,
>
> I'm trying to push presence updates to XMPP clients, and have been working
> with mod_rest. When an HTTP request is sent it gets an error "REST request
> is rejected by service". I'm sure the client IP is allowed in the mod_rest
> configuration so what could be wrong? Thanks in advance.
>
> BTW, if another method instead of mod_rest is recommended I'd be
> interested to hear it.
>
> Using ngrep:
>
> T XX.XX.246.78:42797 -> XX.XX.246.78:5285 [AP]
>   POST /rest HTTP/1.1..TE: deflate,gzip;q=0.3..Connection: TE,
> close..Host: foo.com:5285..User-Agent: foo 1.0..Content-Length:
> 132..Content-Type: application/x-www-form-urlencoded....<presence to="
> david at foo.com" from="other at foo.com"><status>On the
> phone</status></presence>
> ##
> T XX.XX.246.78:5285 -> XX.XX.246.78:42797 [AP]
>   HTTP/1.1 406 Not Acceptable..Content-Type: text/html;
> charset=utf-8..Content-Length: 43....Error: REST request is rejected by
> service.
>
> The HTTP response code suggests that the client is not capable of
> accepting the server’s response. Is your client perhaps sending an Accept
> header such as Accept: text/plain where ejabberd is expecting to send a
> response of content-type application/xml?
>
> JT
>>
> --
> ---------------------------------------+--------------------------------
> James Tait, BSc                        |    xmpp:jayteeuk at wyrddreams.org
> Programmer and Free Software advocate  |        Tel: +44 (0)870 490 2407
> ---------------------------------------+--------------------------------
>
>
>
> _______________________________________________
> ejabberd mailing list
> ejabberd at jabber.ru
> http://lists.jabber.ru/mailman/listinfo/ejabberd
>
>


-- 
David Cunningham, Voisonics
http://voisonics.com/
USA: +1 213 221 1092
Australia: +61 (0) 2 8063 9019
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.jabber.ru/pipermail/ejabberd/attachments/20160725/043cf964/attachment.html>


More information about the ejabberd mailing list