HTTP headers

Alan DeKok aland at deployingradius.com
Tue Nov 30 16:53:53 CET 2021


On Nov 30, 2021, at 10:32 AM, Stjepan Roić <roic27 at gmail.com> wrote:
> 
> There is no debug because the server isn't starting (copy pasting random
> string to config causes syntax error which I assumed you knew).

  Is it your intention to annoy people, or to solve problems?  Because you're doing the first very well.  This needs to stop immediately.

  When people say "it doesn't work", I have no idea what that means. Mostly because many people seem to be obsessed with asking vague questions, and are actively hostile to giving any useful information.  Such as error messages or debug logs.  And then when I ask for more information, they get upset.

  This behavior is not appropriate.

> Believe it or not I have read the documentation, especially
> mods-available/rest and can't understand the syntax for this. It says:

  Which is a much better question than the your previous message.

> Additional HTTP headers may be specified with control:REST-HTTP-Header.
>        #  The values of those attributes should be in the format:
>        #    <attribute>: <value>
> 
> So I tried this:
> 
>        control:REST-HTTP-Header :+secret:
> 1f215f4a27653bd17ddc54e320a1c61e37949fe5
>        control:REST-HTTP-Header :+uuid:
> 84ce0574-5074-4b53-9ddc-fcb2c935a1b1
>        control:REST-HTTP-Header :+Content-Type: application/json

  Which shows you didn't read the documentation.  You can't just put random things into the configuration files.  There's a syntax, which is documented.  See "man unlang", and the documentation around double-quoted strings.  And the documentation around using operators.

  I said to use "+=" as the operator.  Instead, you're using ":+"  ?  Why?

> Debug error:
> /etc/freeradius/3.0/mods-enabled/rest[160]: Expecting section start brace
> '{' after "control:REST-HTTP-Header :+secret:"

  Yes.  Because "man unlang" documents how to set values.  Hint: use the operator I suggested, and the one which is documented.  Don't use ones you invented.

> Than this:
>   ...
> Than this:
..
> ...
> Than this:
> ...
> Than this:
>  ..

  Yeah... that's the approach of "I haven't read Alan's message or the documentation, so I'm just going to try random things in the hope that something will magically work".

  Don't do that.  It's not productive.

> And only thing I can find in unlang docs is similar to what I sent in a
> previous email.

  Or maybe use "+=" as I suggested, instead of ":="?

  Instead of doing that, you've spent all kinds of time doing random things.  I have no idea why.

> So can you provide some examples how it's used or at least a link to the
> docs where it's shown?

  You originally did this:

      update control {
       &REST-HTTP-Header := "secret: 1f215f4a27653bd17ddc54e320a1c61e37949fe5"
       &REST-HTTP-Header := "uuid: 84ce0574-5074-4b53-9ddc-fcb2c935a1b1"
       &REST-HTTP-Header := "Content-Type: application/json"
      }

  I said to use "+=" instead of ":=".   Making that change gives you:

      update control {
       &REST-HTTP-Header += "secret: 1f215f4a27653bd17ddc54e320a1c61e37949fe5"
       &REST-HTTP-Header += "uuid: 84ce0574-5074-4b53-9ddc-fcb2c935a1b1"
       &REST-HTTP-Header += "Content-Type: application/json"
      }

  Which should work.  If it doesn't, don't post another message complaining about how mean I am for helping you.  Doing so will get you banned from the list.  I have zero patience for that nonsense.

  Instead, follow the documentation, and post the debug output.  Which you SHOULD have posted the first time.

  Alan DeKok.




More information about the Freeradius-Users mailing list