Comments (9)
Please provide a detailed description of the problem.
from s3_website.
Users don't have the ability to state the content type when deploying files. When a website gets deployed, proper response headers are not sent. Browsers and servers use this data to figure our proper encoding, languages, etc.
Example from sdk docs:
amazon_bucket.objects.each do |ob|
metadata = ob.metadata
content_type = "UTF-8"
ob.copy_to(ob.key, :metadata{:foo => metadata[:foo]}, :content_type => content_type)
end
from s3_website.
I'm sorry but I don't understand how the thing you are saying relates to this gem. Can you be more specific?
from s3_website.
I don't understand what part your confused about. Every website sends header response data. Your deploy gem does not set these proper headers onto the files being deployed. Each file has the ability to store "metadata". Please re-read my last comment as I showed you an example of what amazon s3 library does to set the metadata on the files.
from s3_website.
Response headers from a site deployed with your gem:
Response headers from a site like google.com:
from s3_website.
s3_website
infers the content-type header from the file extension. Here's the code:
s3_website/lib/s3_website/upload.rb
Line 63 in 0d298ca
Try debugging the code above. Maybe you will find the reason why s3_website
does not set the content-type correctly for you.
from s3_website.
@chonthu I've been wondering about this for a while. I think what is happening is this...
Basically, if the requested object is same as the cached copy held by the client, then instead of a 200 OK
status, (like your google example), you'll actually get a 304 Not Modified
status (like the first response header you posted). Give this a try: do a hard refresh on one of your web pages (Command-Shift-R). This will delete your cache and the server will resend the file, and you should now see the correct Content-Type header.
Relevant AWS docs here: http://docs.aws.amazon.com/AmazonS3/latest/dev/CustomErrorDocSupport.html
from s3_website.
Closing this as "will not fix".
from s3_website.
I had the same problem. The Content-Type for all my .html files uploaded by s3_website were being set to: application/xhtml+xml
For me, the problem was that the mime-type was being detected as xml instead of html. I was able to fix my problem by changing my Jekyll layout from:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" dir="ltr" lang="en">
to:
<!DOCTYPE html>
<html>
from s3_website.
Related Issues (20)
- Private S3 bucket
- Configure custom response codes
- Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty HOT 4
- Compatibility with CloudFront "Origin Access Identity" usage?
- sun.security.validator.ValidatorException: PKIX path building failed HOT 1
- Support behind proxy HOT 1
- issues with deployment to us-east-2 region
- HTTP to HTTPS Redirection HOT 4
- cfg apply results in Aws::CloudFront::Errors::MalformedInput
- S3 listObjects is iterating through whole bucket
- Is it possible to redirect with query string
- Errors parsing ERB on s3_website push HOT 11
- Upload fail with accent characters HOT 1
- Exception in thread "main" java.lang.ExceptionInInitializerError HOT 6
- No redirects to configure for `bucket-name` bucket HOT 1
- Cant download
- Hugo Deploy: Migrating from S3 Website HOT 1
- Looking for new maintainers HOT 7
- Who's still using s3_website HOT 9
- unsupported Java version: 17 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from s3_website.