Ignore:
Timestamp:
2008-04-17T13:52:05+12:00 (16 years ago)
Author:
mdewsnip
Message:

Now each action checks for invalid arguments in the params structure and deletes any that aren't valid, so they don't get into the "<request>" tag in the resulting XML and cause OAI validation errors. By DL Consulting Ltd.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/src/oaiservr/metaformatsaction.cpp

    r9608 r15198  
    55bool metaformatsaction::validateAction(recptproto *protocol, oaiargs &params)
    66{
     7  int params_size = params.getSize();
     8
     9  // Remove any parameters that aren't valid for this action
     10  text_tmap::const_iterator param_iterator = params.begin();
     11  while (param_iterator != params.end())
     12  {
     13    if (param_iterator->first != "verb" &&
     14    param_iterator->first != "identifier")
     15    {
     16      params.erase(param_iterator->first);
     17    }
     18
     19    param_iterator++;
     20  }
     21
    722  int numArgs = 1; // the number of expected arguments
    823 
     
    1530  // If the total number of params isn't equal to the number of valid
    1631  // args (i.e. we have an arg but it isn't the identifier), throw an error 
    17   if((params.getSize() != numArgs)){
     32  if((params_size != numArgs)){
    1833    this->errorType = "badArgument";
    1934    return false;
Note: See TracChangeset for help on using the changeset viewer.