Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6831185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:42:28+00:00 2026-05-26T22:42:28+00:00

I would like to change the http-header Server: value dynamically (while building the respond)

  • 0

I would like to change the http-header “Server: “ value dynamically (while building the respond) in yaws. I tried:-

[{status, 200},
 {allheaders,
      [{header,
          ["Server: ","ASP.NET Development Server/10.0.0.0"]
      }]
 },
 {html,Body}
]

it returned two “Server: “ headers instead of one. But it worked for all other headers.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T22:42:28+00:00Added an answer on May 26, 2026 at 10:42 pm

    For Older Versions of yaws (yaws-1.90 and below) the answer below works


    Now, by default, any header specified as [{header,"Server: MyOther Server Name"}] , yaws will enforce and tag its name and version before your server header value, like this: Server: Yaws 1.91, MyOther Server Name. This occurs when in your out/1 function you end with a header value, server like this:

    out(_A)-> 
    [{header,"Server: ASP.NET Server"},
    {html,"<p>I love klacke and yaws ! </p>"}].

    Checking your browser, using Firebug you see the Response headers specified as follows:

    
    Date            Thu, 17 Nov 2011 07:59:17 GMT
    Content-Length  22
    Content-Type    text/html
    Server          Yaws 1.91, ASP.NET Server
    

    Now the solution:

    In the yaws src, there is a module called yaws.erl. In this module, check around line: 1332, you will find a function like this:

    make_server_header() ->
        HasDav = ?sc_has_dav(get(sc)),
        ["Server: ", (get(gc))#gconf.yaws, "\r\n" |
         if HasDav == true ->
                 ["DAV: 1\r\n"];
            true ->
                 []
         end].
    

    This is the piece of code that appends the yaws version and server name on top of your server header specified value. We need to change it and comment out the lines and let it return an empty list [ ] or empty string "" to look like this:

    make_server_header() ->
        %%HasDav = ?sc_has_dav(get(sc)),
        %%["Server: ", (get(gc))#gconf.yaws, "\r\n" |
        %% if HasDav == true ->
        %%         ["DAV: 1\r\n"];
        %%    true ->
        %%         []
        %% end].
        []. %% force it to just return empty
    
    

    Last step
    Now we need to re-compile this module and replace the existing yaws.beam file in YAWS-{VSN}/ebin with the new resulting .beam file we get after compiling this new source. Then reload it in the VM. I hope you can find your way in this last step. One way of pulling this off is by changing the current working directory of your yaws running erlang shell

    1> cd("PATH/TO/YAWS/src").
    PATH/TO/YAWS/src
    

    Then, execute this (still in the yaws shell) after changing the source of the yaws.erl as we have mentioned above

    2> c(yaws).
    {ok,yaws}
    

    Now move the generated yaws.beam file from src to ebin. Overwrite/ replace the existing yaws.beam file in ebin with the one from src

    $ mv PATH/TO/YAWS/src/yaws.beam PATH/TO/YAWS/ebin/
    

    So, if yaws is running, reload that code by entering in its shell:

    3> l(yaws).
    

    For Newer versions of yaws (yaws-1.91 and above)


    There is a parameter you will just add to your yaws.conf file

    server_signature = "MY SERVER SIGNATURE"

    And so the headers will come with Server: MY SERVER SIGNATURE

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For SEO purposes, we would like to change the HTTP status code returned whenever
I would like to change: http://example.com/index.php?p=blog&pid=2&lid=1&l=en into just http:// example.com/en/blog.html or just http:// example.com/blog.html
Using Javascript, I would like change the background color of the numbers in an
I would like to change the database files location of MySQL administrator to another
I would like to change the Row Source values in an Access table through
I would like to change the default behavior of Joomla's password reminding mechanism. I
I would like to change the contents of the list of a JComboBox (like
I would like to change the name of the ruby process that gets displayed
I would like to change the behaviour of the insert button on the standard
I would like to change visual studio's default configurations (Debug,Release). That is, change the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.