0

I have embedded mongoose in a C++ application used for develop and test web systems. When these web systems are running locally there is no need for security. It should run like an anonymous authentication system. I didn’t find any way to do this in mongoose so I rewrote the “authorize” method to

static int authorize(struct mg_connection *, struct file *) {
   return 1;
}

Normally the authorize method validates user. Is there another way to configure mongoose to run like anonymous? And is there a problem rewriting the authorize method like this.

JohnnyHK
  • 305,182
  • 66
  • 621
  • 471
Per Ghosh
  • 449
  • 5
  • 10

1 Answers1

2

Authorization function you've mentioned looks for .htpasswd file inside respective directory. If .htpasswd file is not there, authorization succeeds. So you don't need to make any changes at all, just don't create .htpasswd files.

valenok
  • 827
  • 7
  • 9
  • The only value of emptying the authorize function is it no longer hits the file system looking for a .htpasswd file that will never exist. – jmucchiello Jun 10 '13 at 01:14