Skip to content

Commit

Permalink
doc If-Match and If-None-Match in Spanish readme
Browse files Browse the repository at this point in the history
  • Loading branch information
gnandretta committed Sep 18, 2011
1 parent a90d923 commit f602a16
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.es.rdoc
Expand Up @@ -1055,6 +1055,23 @@ Usá la configuración <tt>:static_cache_control</tt> para agregar el encabezado
<tt>Cache-Control</tt> a archivos estáticos (ver la sección de configuración
para más detalles).

De acuerdo con la RFC 2616 tu aplicación debería comportarse diferente si a las
cabeceras If-Match o If-None-Match se le asigna el valor <tt>*</tt> cuando el
recurso solicitado ya existe. Sinatra asume para peticiones seguras (como get)
e idempotentes (como put) que el recurso existe, mientras que para el resto
(como post), que no. Podes cambiar este comportamiento con la opción
<tt>:new_resource</tt>:

get '/crear' do
etag '', :new_resource => true
Articulo.create
erb :nuevo_articulo
end

Si querés seguir usando una weak ETag, indicalo con la opción <tt>:kind</tt>:

etag '', :new_resource => true, :kind => :weak

=== Enviando Archivos

Para enviar archivos, podés usar el método <tt>send_file</tt>:
Expand Down

0 comments on commit f602a16

Please sign in to comment.