Layer7 API Management

  • 1.  Annoying favicon.ico log messages in API Gateway

    Posted May 19, 2017 05:57 PM

    I see a lot of annoying messages in my ssg logs

    com.l7tech.server.MessageProcessor: Request URL not resolved: https://api_gw_fqdn/favicon.ico

    I believe I understand this to be user's browsers trying to get the little icon that shows up in the favorites bar in some browsers.  

     

    Can I add a web api at that url that simply returns an icon file to get rid of these messages?  

    --or--

    Can I add a web api at that url that simply returns "ok" since I really don't want to give someone an icon file

    --or--

    would i be causing my gateway more "effort" than it is worth to serve that file or this "ok" message and just live with this in the logs.  



  • 2.  Re: Annoying favicon.ico log messages in API Gateway

    Broadcom Employee
    Posted May 19, 2017 08:07 PM

    Good afternoon,

     

    We have seen a several ways to handle this depending on the end result. 

     

    1) Ignore the error message

    2) Create a service with */favicon.ico as the URI and return an empty return template with status 200

    3) Create a service with */favicon.ico as the URI that links to central location to get your corporate favicon using a HTTP routing assertion and use the cache assertion store and retrieve to avoid excessive outbound calls, or take the hex value of the favicon file and put it in a return template.

     

    Sincerely,

     

    Stephen Hughes

    Director, CA Support 



  • 3.  Re: Annoying favicon.ico log messages in API Gateway
    Best Answer

    Broadcom Employee
    Posted May 21, 2017 08:51 PM
      |   view attached

    Hello pwhelan81 ,

    If you like to return a real favicon, you may,

    1. Publish /favicon.ico endpoint (base64 encode an icon image first, put it in src context variable, Request source of Route via http is set as message target)

    2. Publish /showicon endpoint

     

    Sample policies are attached.

     

    Regards,

    Mark

    Attachment(s)

    zip
    favicon.zip   3 KB 1 version


  • 4.  RE: Re: Annoying favicon.ico log messages in API Gateway

    Posted Jul 09, 2020 05:00 AM
      |   view attached
    Ik can be done even easier with 2 assertions in 1 policy service.
    -set context var to the base64 encoded string of the favicon. (I used https://base64.guru/converter/encode/image/ico to convert my image)
    -decode this variable as the response message with content type 'image/vnd.microsoft.icon'