mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 01:02:45 +00:00 
			
		
		
		
	LibWeb: Improve <form> submit method handling
The spec defines the only valid methods to be get, post, and dialog. Post and dialog are currently unhandled and do nothing, any other value (or no value specified) is defined by the spec to use the get method.
This commit is contained in:
		
							parent
							
								
									72d2bd56ce
								
							
						
					
					
						commit
						4d5dc5950a
					
				
					 1 changed files with 7 additions and 3 deletions
				
			
		|  | @ -48,9 +48,13 @@ void HTMLFormElement::submit() | |||
|         return; | ||||
|     } | ||||
| 
 | ||||
|     if (method().to_lowercase() != "get") { | ||||
|         dbg() << "Unsupported form method '" << method() << "'"; | ||||
|         return; | ||||
|     auto effective_method = method().to_lowercase(); | ||||
|     if (effective_method != "get") { | ||||
|         if (effective_method == "post" || effective_method == "dialog") { | ||||
|             dbg() << "Unsupported form method '" << method() << "'"; | ||||
|             return; | ||||
|         } | ||||
|         effective_method = "get"; | ||||
|     } | ||||
| 
 | ||||
|     URL url(document().complete_url(action())); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Shadowfacts
						Shadowfacts