0 Replies Latest reply on Apr 10, 2015 5:23 PM by hfluz

    Hide real file name in undertow image-handler

    hfluz

      I tried the undertow image handler with the following configuration:

       

                  <server name="default-server">
                      <http-listener name="default" socket-binding="http"/>
                      <host name="default-host" alias="localhost">
                          <location name="/images" handler="images-handler"/>
                      </host>
                  </server>
                  <handlers>
                      <file name="images-handler" path="/opt/files" directory-listing="true"/>
                      <file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>
                  </handlers>
      

       

      It works really great and I can access my images through http://ip:port/images/image_name.jpg. However I dont want the user to be able to guess the name of other images, like profile photos of other users by their identification.

       

      Does undertow support any way to hash the file name and display the hashed name in the url instead of its real name? Or will I have to try to use a url rewriter or maybe hash the image names in the filesystem?